I believe that the issue has to do with the 'PlotBoxAspectRatioMode'
property of your axes being set to 'auto'
when they're first created. You'll need to specify your axis limits with axis
or use of the other options. If it's suitable for your data, try specifying axis equal
for each axis. Or maybe axis square
.
How to make a movie of a subplot, in which each subplot is a frame?
-
24-06-2022 - |
Domanda
I have to do exactly what my title says. I have a figure with a subplot, for example 3-by-5. I want to take all different graph inside the subplot and make each one of them a frame (in this case, 15 different frames). I have tried different solution but nothing worked. For example I tried:
writerObj = VideoWriter('try.avi');
writerObj.FrameRate = 1;
open(writerObj);
h= figure(1);
for x=1:15
hh=subplot(3,5, x);
frame=getframe(hh);
writeVideo(writerObj,frame);
end
close(writerObj);
Or I tried
writerObj = VideoWriter('try.avi');
writerObj.FrameRate = 1;
open(writerObj);
h= figure(1);
fig=gcf;
axesHandles = get(gcf,'children');
for x=1:15
hh=subplot(3,5, x);
frame=getframe(axesHandles(x));
writeVideo(writerObj,frame);
end
close(writerObj);
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow