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