Matlab how to draw multiple subplots on an inactive window.
3 views (last 30 days)
Show older comments
Hi, I wish to draw 64 subplots on one figure window one-by-one using matlab r2016a. It usually takes about 2-3 seconds to draw each subplot. I have met some problems now.
Originally I use the code:
figure
for i=1:64
% calculate something here
axes('position',PositionVector(:,i)); % PositionVector has been calculated before.
plot(Something Here);
drawnow;
end
As you can see, the code shows each subplot one-by-one, and it can work correctly. But when I click on another existing figure (say figure(3)), it started to plot on figure(3), which is very annoying. So I change the code to:
[Number,~]=size(findobj('Type','figure')); % Find how many figures has opened.
for i=1:64
% calculate something here
set(figure(number+1), axes('position',PositionVector(:,i))); % PositionVector has been calculated before.
plot(Something Here);
drawnow;
end
Now it can draw all the subplots on one particular figure window, but it brings another problem: that figure window can't be inactve. When I minimize it, it pops out. When I click on another full-screen figure window, it shows up. Also very annoying.
I want matlab to draw all the subplots on one particular figure window, and show them up one by one NO MATTER WHAT CURRENT FIGURE WINDOW I`M LOOKING AT. How to do this?
0 Comments
Answers (1)
michio
on 3 Sep 2016
I think the issue will be resolved if you specify which axes to make a plot on. Try
handle_figure = figure;
for i=1:64
% calculate something here
handle_axes = axes('position',PositionVector(:,i), 'Parent', hande_figure);
plot(handle_axes, rand(10,1));
drawnow;
end
plot(handle_axes, rand(10,1)); will draw a plot on the specified axes, which is created on the specified figure.
0 Comments
See Also
Categories
Find more on Graphics Performance 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!