Extending the curtain plot (reference plane) when 3D plotting with meshz
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponse acceptée
the cyclist
le 23 Août 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 commentaires
the cyclist
le 24 Août 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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Graphics Performance dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!