![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/173140/image.png)
Partial transparent surface plot
4 ビュー (過去 30 日間)
古いコメントを表示
Hello together,
I'm trying to plot a surface where all points with a z value between -0.5 and 0.5 are 100% transperent. I've tried to make all these values to NaN (not a number). This works, so far, that the surface looks like expected, but i can not use the data cursor. When using the data cursor matlab crashes. Is there another way of makeing areas transparent or does anyone know, why matlab crashes?
Thank you for your help.
Rafael
0 件のコメント
採用された回答
Massimo Zanetti
2017 年 3 月 9 日
編集済み: Massimo Zanetti
2017 年 3 月 9 日
Play with Chart Surface Options: https://it.mathworks.com/help/matlab/ref/chartsurface-properties.html
You can set AlphaData to 0 where you don't want to see any colour. Here is an example hiding values of a trigonometric function between 0 and 1:
[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);
s = surf(X,Y,Z);
s.AlphaData = (Z<=0) | (Z>=1);
s.FaceColor = 'texturemap';
s.FaceAlpha = 'texturemap';
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/173140/image.png)
2 件のコメント
Massimo Zanetti
2017 年 3 月 9 日
編集済み: Massimo Zanetti
2017 年 3 月 9 日
Are you just visualizing the image or trying to print it using print? Please, post some of your code.
Note: The 'zbuffer' option has been removed. Use 'opengl' or 'painters' instead.
What Matlab version are you using?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!