setting color using surf in axes (guide)

1 回表示 (過去 30 日間)
UNAL
UNAL 2017 年 6 月 19 日
回答済み: KSSV 2017 年 6 月 20 日
Dear all,
I'm doing a surface plot in an axes object (guide), but the surface don't get any color. What should I do to get color in the surface?.
I'm using following commands:
axes(handles.axes1)
[X,Y,Z] = peaks(25);
C = X.*Y;
surf(X,Y,Z,C)
Regards,
Luis
  1 件のコメント
UNAL
UNAL 2017 年 6 月 19 日
The following code works, but when I use alpha(.5) or surf(X,Y,Z,CO,'FaceColor', 'interp','FaceAlpha',0.5), the surface get without color. What should I do to get transparency?:
axes(handles.axes1)
[X,Y,Z] = peaks(25);
CO(:,:,1) = zeros(25);
CO(:,:,2) = ones(25)*0.2;
CO(:,:,3) = abs(Z)./max(max(Z));
surf(X,Y,Z,CO,'FaceColor', 'interp')
Thanks

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2017 年 6 月 20 日
[X,Y,Z] = peaks(25);
CO(:,:,1) = zeros(25);
CO(:,:,2) = ones(25)*0.2;
CO(:,:,3) = abs(Z)./max(max(Z));
surf(X,Y,Z,CO)
alpha 0.5 ;

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by