Visibility of a simple 'plot' on tip of a 'surface'
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 21 de Mzo. de 2014
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 comentarios
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!