Visibility of a simple 'plot' on tip of a 'surface'
1 回表示 (過去 30 日間)
古いコメントを表示
I have a surface and am going to put a simple plot (which is a line connecting a few dots) on top of the surface. How can I do that?
I draw the surface and use 'hold on', and then draw the simple plot, but the simple plot goes behind the surface...
0 件のコメント
回答 (1 件)
Walter Roberson
2014 年 3 月 21 日
Give the plot a slightly larger z value than the surface. Well, not exactly z value, really, but a coordinate which is slightly closer along the viewing angle than the surface itself is.
When you have a line and a surface at the same distance along the projection, then if you are in OpenGL (not unlikely for surface plots) then OpenGL has its own ideas of which should be drawn first, and nothing you can do by using uistack() can alter what OpenGL will do. So you separate them slightly so that one is "closer".
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!