4.85714

4.9 | 7 ratings Rate this file 15 Downloads (last 30 days) File Size: 4.08 KB File ID: #21414
image thumbnail

linkzoom.m v1.3 (Aug 2009)

by Carlos Adrian Vargas Aguilera

 

11 Sep 2008 (Updated 20 Aug 2009)

Links the ZOOM and PAN regions of different axes.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

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)
>> ...
>> linkzoom % links all axes on current figure!

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)

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
tlabel.m v2.6.1 (Sep 2009)
This submission has inspired the following:
addaxes.m v1.1 (Sep 2009)

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
11 Sep 2008 An User

It works.

12 Sep 2008 John D'Errico

Nothing more to say here than - well done.

09 Jul 2009 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.
Thank you Carlos Adrian!

22 Jan 2011 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!

09 Nov 2011 David Chen

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.

01 Dec 2011 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/

17 Jan 2012 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.

Please login to add a comment or rating.
Updates
19 Jun 2009

1) Fixed bug with already zoomed axes.
2) Changed the example.

29 Jul 2009

v1.2 Fixed small bug with ZOOM OUT and Double-Click. Other minor changes.

20 Aug 2009

v1.3 Fixed bug when using PLOTYY.

Tag Activity for this File
Tag Applied By Date/Time
data exploration Carlos Adrian Vargas Aguilera 22 Oct 2008 10:19:00
linkaxes Carlos Adrian Vargas Aguilera 22 Oct 2008 10:19:00
zoom Carlos Adrian Vargas Aguilera 22 Oct 2008 10:19:00
pan Carlos Adrian Vargas Aguilera 22 Oct 2008 10:19:00
linkprop Carlos Adrian Vargas Aguilera 22 Oct 2008 10:19:00
subplot Carlos Adrian Vargas Aguilera 22 Oct 2008 10:19:00
link Carlos Adrian Vargas Aguilera 22 Oct 2008 10:19:00
tlabel Carlos Adrian Vargas Aguilera 19 Jun 2009 15:58:50
image processing Carlos Adrian Vargas Aguilera 19 Jun 2009 15:58:51
signal processing Carlos Adrian Vargas Aguilera 19 Jun 2009 15:58:51
potw Shari Freedman 02 Jul 2009 10:12:53
plotyy Carlos Adrian Vargas Aguilera 30 Jul 2009 09:52:18
pick of the week Jiro Doke 11 Feb 2011 20:10:23

Contact us at files@mathworks.com