squarezoom

PURPOSE ^

SQUAREZOOM - zoom on a part of a figure

SYNOPSIS ^

function squarezoom()

DESCRIPTION ^

SQUAREZOOM - zoom on a part of a figure

   Usage:
      squarezoom()

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function squarezoom()
0002 %SQUAREZOOM - zoom on a part of a figure
0003 %
0004 %   Usage:
0005 %      squarezoom()
0006 
0007 disp('Click twice to define a square where you want to zoom. First click for upper left corner, second for lower right corner');
0008 [x,y]=ginput(2);
0009 dx=x(2)-x(1);
0010 dy=y(1)-y(2);
0011 
0012 if dx>dy,
0013     delta=dx-dy;
0014     xlim([x(1) x(2)]);
0015     ylim([y(2)-delta/2 y(1)+delta/2]);
0016 else
0017     delta=dy-dx;
0018     xlim([x(1)-delta/2 x(2)+delta/2]);
0019     ylim([y(2) y(1)]);
0020 end

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003