Is there a way to disable automatic resizing of figures to fit within Figure window?
31 views (last 30 days)
Show older comments
Dear community, I am trying to plot a series of plots (~100 of them) on the same matlab figure so I can quickly scroll through them and see which ones are interesting. My code seems to be working ok for a small number of plots, but when the number of plots gets larger the Matlab figure resizes them so that all of them fit in into the area of the Figure window displayed without needing to scroll up and down, making the subplots very small. In addition, Matlab won't allow me to zoom in to see them (clicking the zoom icon and selecting areas I want to see does not change the view, it seems to be stuck). Is there a way to disable this automatic resizing, so that I have a long figure of reasonably sized plots that I can scroll though and visually inspect?
figure
for plotno = 1:100
subplot(100,1,plotno);
plot(x,y)
xlim([0 4])
ylim([0 10])
ax=gca
ax.PlotBoxAspectRatio = [3 1 1]
end
0 Comments
Answers (1)
Walter Roberson
on 2 Jan 2018
3 Comments
Walter Roberson
on 2 Jan 2018
Try this:
create a uipanel "Outer", with cropping turned on. This will act as a "window" on to what is inside. Inside that uipanel, put a second uipanel "Inner" parented to the "Outer" uipanel. Set the "Inner" uipanel to be Units 'pixel' and to be big -- larger than the screen. Only part of the Inner panel will be visible inside of the crop frame that is Outer. Now, somewhere outside of "Outer", add your two scroll bars. The scrollbars are responsible for setting the Position property of Inner, keeping its width and height the same but changing the x and y to be the negative of the position you want to be displayed at the bottom left corner of the virtual panel (e.g., x of -1000 would move the virtual "paper" to the left so that position 1000 would be at the left of the page.)
See Also
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!