custom alpha-data in surface plot

7 次查看(过去 30 天)
Björn
Björn 2013-9-18
评论: Björn 2013-10-4
I am plotting multiple surfaces in one figure. Now I want to make the areas of the plot close to zero a transparency-gradient. For example
if z(i,j) >= 0 && z(i,j) <= 0.1
transparancy(i,j) = 1-z(i,j)/0.1;
else
transparancy(i,j) = 0;
end
I tried using the 'alpha' function and the colormap method but didn't succeed. Can anybody help me on my way?

回答(1 个)

Walter Roberson
Walter Roberson 2013-9-18
Do not use the alpha function: use the AlphaData property of the surface object.
surf(z, 'AlphaData', transparancy)
  1 个评论
Björn
Björn 2013-10-4
I tried this but it doesn't change anything. Do you have another suggestion?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by