Four different figures of same plot - 3D plot, XZ, XY, YZ Plot
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nick S
el 4 de Mzo. de 2016
Respondida: Walter Roberson
el 4 de Mzo. de 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 comentarios
Respuesta aceptada
Walter Roberson
el 4 de Mzo. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!