Visibility of a simple 'plot' on tip of a 'surface'

1 visualización (últimos 30 días)
MJ
MJ el 21 de Mzo. de 2014
Respondida: Walter Roberson el 21 de Mzo. de 2014
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...

Respuestas (1)

Walter Roberson
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".

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!

Translated by