Borrar filtros
Borrar filtros

Extending the curtain plot (reference plane) when 3D plotting with meshz

2 visualizaciones (últimos 30 días)
Hi all,
I am using to meshz to display a 3D plot, but the curtain only extends to the extrema of the data points. In this particular case, the curtain falls inconveniently above the height 0.
Is it possible to drop the curtain to a specified height, namely 0? If so, how?
-Thanks,
Hussain

Respuesta aceptada

the cyclist
the cyclist el 23 de Ag. de 2011
The values you want are stored in the "ZData" property of the plot. So, you need to grab those data, modify them, and set them again. The code below is something like what you need, although I am not 100% I understood whether you wanted to cut off below or above zero, so you might need to adjust things.
oldZData = get(get(gca,'Children'),'ZData')
newZData = min(0,oldZData);
set(get(gca,'Children'),'ZData',newZData)
EDIT IN RESPONSE TO COMMENT:
oldZData = get(get(gca,'Children'),'ZData');
newZData = oldZData;
newZData(min(oldZData(:))==oldZData) = 0;
set(get(gca,'Children'),'ZData',newZData)
  3 comentarios
the cyclist
the cyclist el 24 de Ag. de 2011
OK. I think I understand. I have added some different code to my answer, that I think does what you want. It identifies the points that are at the bottom of the current curtain, replaces those points with zeros, and redraws the new curtain.
Hussain
Hussain el 24 de Ag. de 2011
Thanks! Your suggestion mostly solves the problem; it certainly pulls the curtain down to zero as I had hoped. However, by setting the minimum data point (or any data point for that matter) to zero, the presented data also has a false 0.
I managed to solve the problem in sort of a one-time-use-be-very-careful way by examining the meshz routine. The original programmer conveniently marked where the position of the curtain is defined, zref, as the minimum of a the finite z matrix. I made a modified copy of the routine in which zref = 0, which does the trick very cleanly in this case.
Thanks for your help! Your answer motivated my investigation into the meshz routine.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D 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