File Exchange

version 1.3.0.0 (4.08 KB) by
Links the ZOOM and PAN regions of different axes.

Updated 20 Aug 2009

Editor's Note: This file was selected as MATLAB Central Pick of the Week

LINKAXES links the axis limits of several axes. LINKZOOM links the ZOOM and PAN regions ignoring the axes limits, then, it can be used to link several axes with different limits.

Usage:

>> subplot(311)
>> ...
>> subplot(312)
>> ...
>> subplot(313)
>> ...

and that's it. Make a zoom or a panning of any of the axes and the others will do the same!

Other options are the figure or axes handles and the axis to be linked: 'x' or 'y' or both 'xy' (default).

By now the panning is actualized on all axes until the mouse is released :P, any help?

Check out the included example to notice the difference with LINKAXES.

(Bugs reports and suggestions will be very appreciated)

### Cite As

Josh Zimmerman

this file works great, but you have to make sure your axes sizes are the same. If you use a function like multiplotyyy with this which creates different sized axis it will skew the x axis in the zooming. (see jsplotys.m which is a is similar to multiplotyyy.m, but lets you use linkzoom.m)

happy

Hi Carlos. I like your function, but it is not working 'correctly' when using a plot with more than two y-axes, like produced with the function 'ploty4' (can be downloaded on file exchange). Here the plots in different axes are drawn away from each other. Suppose that two lines y1(x) and y2(x) are crossing at a special point (x0,y1(x0)=y2(x0)). If I zoom on the plot in the axes of y1 at the point, (x0,y1(x0)) The lines will not cross anymore. 'linkzoom' moves the axes differently.

Matteo Niccoli

Hi Carlos. Fantastic function. Please check how I used it in here:
http://mycarta.wordpress.com/2011/11/29/image-processing-tips-for-geoscientists-part-1/

David C

This works great, but I'm getting errors at the prompt when running this:
Undefined function or method 'getProxyValueFromHandle'
for input arguments of type 'double'.
Maybe I'm running a newer version (2011a). Any help would be appreciated.

Michelle

Thank you. Finally, a way to zoom in on multiple axes at once, regardless of whether the axes have different x and y limits from one another. I have been looking for just such a solution for weeks!

Andres

Very very good! Just when I needed such a function, linkzoom appeared as the Pick of the Week. As I mentioned there, it works well with addaxis, http://www.mathworks.com/matlabcentral/fileexchange/9016 , without the need to replace the original zoom function.

John D'Errico

Nothing more to say here than - well done.

An User

It works.

##### MATLAB Release Compatibility
Created with R2008b
Compatible with any release
##### Platform Compatibility
Windows macOS Linux