Four different figures of same plot - 3D plot, XZ, XY, YZ Plot

1 view (last 30 days)
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!

Accepted Answer

Walter Roberson
Walter Roberson on 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

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!