Site hosted by Angelfire.com: Build your free website today!

moveplot

PURPOSE ^

function moveplot(h,option)

SYNOPSIS ^

function moveplot(h,opt,tool)

DESCRIPTION ^

 function moveplot(h,option)

 INPUTS:      h = handle to a line object (e.g. created by a plot command)
         option = [  'x' | 'y' | {'xy'} | 'axy' ]

 This function, once enabled, allows the user to manipulate the coordinates of any
 point in a line object specified by handle h, simply by clicking and moving the mouse.

 If the function is invoked with no option, or with the option 'xy', then clicking the mouse 
 over the line will allow the user to drag the point to a new x- and y- coordinate, as long 
 as the new x coordinate is between the two adjacent points.  If the function is invoked 
 with the option 'x' or 'y' then the point will only move in the specified coordinate, 
 leaving the other coordinate fixed. 

 If the function is called with the option 'x' or with the option 'axy', the x-coordinate 
 will not be limited to values between adjacent points.

 When the button is released, the point will take on the new values.

 EXAMPLE:
 >> h = plot(x, sin(x));
 >> moveplot(h,'xy')
 >>

 If the function is invoked on a line which already uses the moveplot function, then the
 function will be disabled.  If the function is called on a line with z-data, then the
 function will return an error and not be invoked.

 The function can also be disabled by calling it with the opt argument equal to 'off'.

 EXAMPLE:
 >> moveplot(h,'off')
 >>

 This function makes use of the current axes' 'userdata' property, which must be made available
 to it.  During the immediate execution of the function (i.e. as long as the button is being held down), 
 the axes' 'userdata' property is unavailable; however, upon the release of the mouse button, the
 function restores the axes' userdata to its initial value.

 Written by Brandon Kuczenski for Kensington Labs
 brandon_kuczenski@kensingtonlabs.com
 17 September 2001

 Modified to restore button functions to original state
 And test for double-click to end moveplot action
 Alex Woo, woo@geomi.com
 26 February 2002

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^


Generated on Sat 12-Mar-2005 01:01:49 by Rezaul Karim © 2004