I have multiple subplots in one figure. The X axis of each plot is the same variable (time). The Y axis on each plot is different (both in what it represents and the magnitude of the data).
I would like a way to zoom in on the time scale on all plots simultaneously. Ideally by using the rectangle zoom tool on one of the plots, and having the other plots change their X limits accordingly. The Y limits should remained unchanged for all of this. Auto fitting the data to fill the plot in the Y direction is acceptable.
(This question is almost identical to Stack Overflow question one Matplotlib/Pyplot: How to zoom subplots together? (except for MATLAB))
Ideally by using the rectangle zoom tool on one of the plots, and having the other plots change their X limits accordingly. The Y limits should remained unchanged for all of this. Auto fitting the data to fill the plot in the Y direction is acceptable.
When zoom mode is on, to zoom in, position your cursor where you want the center of the axes to be and either scroll up or click. To zoom out, either scroll down or hold Shift and click. Each click zooms in or out by a factor of 2. To zoom into a rectangular region, click and drag.
It's possible to make subplots of different sizes by specifying a multiple-element vector for the grid position argument p in the syntax subplot(m,n,p) . Show activity on this post. You can add 4 axeses to the figure, and set the position of each axes: I = imread('cameraman.
You can link any number of Axes objects. For example, linkaxes([ax1 ax2 ax3]) links ax1 , ax2 , and ax3 . Separate calls to linkaxes([ax1 ax2]) and linkaxes([ax2 ax3]) cancels the link between ax1 and ax2 .
Use the built-in linkaxes function as follows:
linkaxes([hAxes1,hAxes2,hAxes3], 'x');
For more advanced linking (not just the x or y axes), use the built-in linkprop function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With