custom alpha-data in surface plot

7 Ansichten (letzte 30 Tage)
Björn
Björn am 18 Sep. 2013
Kommentiert: Björn am 4 Okt. 2013
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?

Antworten (1)

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

Melden Sie sich an, um zu kommentieren.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by