makeConstrainToRectFcn - Create rectangularly bounded drag constraint function

Syntax

fcn = makeConstrainToRectFcn(type, xlim, ylim)

Description

fcn = makeConstrainToRectFcn(type, xlim, ylim) creates a drag constraint function for draggable tools of a given type, where type is the string: 'impoint', 'imline', or 'imrect'. The rectangular boundaries of the drag constraint function are described by the vectors xlim and ylim where xlim = [xmin xmax] and ylim = [ymin ymax].

Examples

Constrain drag of impoint within axes limits.

figure, plot(1:10);
h = impoint(gca,2,6);
fcn = makeConstrainToRectFcn('impoint',get(gca,'XLim'),get(gca,'YLim'));
setPositionConstraintFcn(h,fcn);

See Also

impoint, imrect, imline, imdistline

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS