Four different figures of same plot - 3D plot, XZ, XY, YZ Plot
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nick S
le 4 Mar 2016
Réponse apportée : Walter Roberson
le 4 Mar 2016
Hi
I have a 3D plot and want to see all of the 2D views as separate figures. I know how to use the view command to see what I want (i.e. view([0 90])), but it just updates the current figure. I'd like to have four different figures of the same plot: one 3d, one a 2D XY view, one a 2D XZ view, and one a 2D YZ view. How can I open up new figures for each view?
Thanks!
0 commentaires
Réponse acceptée
Walter Roberson
le 4 Mar 2016
You cannot have multiple figures with the same plot. Each plot can have only one parent. You can copyobj() the graphics into multiple figures and you can call view() on each of the resulting new axes, specifying the axes handle as the first argument.
For example,
curax = gca(); %what we are copying
views = [0 90 0; 90 0 0; 0 0 90];
titles = {'xy view', 'yz view', 'xz view'}; %you will need to fix these!
for extra_view = 1 : size(views,1)
newfig = figure();
newax = copyobj(curax, newfig);
view(newax, views(extra_view,:));
titles(newax, titles{extra_view});
set(newfig, 'Name', titles{extra_view});
end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!