File Exchange

image thumbnail


version 1.0 (4.47 KB) by

Magnify contents of dragged rectangle to other figure.

1 Download


No License

Editor's Note: This file was a File Exchange Pick of the Week

Displays the contents of a displayed draggable rectangle on one axis of a source figure into an axis in a target figure. The difference in the screen size of the target axis and the size of the rectangle represents the magnification factor that the contents of the source rectangle will appear in the target figure.

Backwards compatible to R12.1 at least. Much smoother under R14x though.

Update of 3/29:
1) Put in arrow keys to have individual control over rectangle width and height
2) Saved size state of rectanglebetween drags and added 'r' key to restore default rectangle proportion (20% of axes)
3) Added 'm' key to toggle between maximizing target axis and having it be the original. Also, 'm' as argument to default to maximized vs orignal size.
4) Tried to fix wierd event timing bugs that would result in residual rectangles. The biggest fix came by disallowing the right mouse button.

Comments and Ratings (4)

Peter Burns

Peter Burns (view profile)

Very useful function. However, the latest version of Matlab complains about the use of 'EraseMode' property (in line 159). Suggest using animatedline. Any thoughts about how to modify? Thanks.

Raz Shimoni

Very nice tool.

Rodolfo Limas

very slick

John D'Errico

A slick variation on magnify.


Arrow keys to change rect width,height
Saved size of rect between drags & added 'r' key to restore default rect.
'm' key to toggle between orig. & max target axis
fix event bug that yielded residual rects by disallowing the right mouse.

MATLAB Release
MATLAB 7.0.1 (R14SP1)

Inspired by: magnify

Inspired: On-figure magnifier, TACTICS Toolbox

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video