4.0

4.0 | 4 ratings Rate this file 147 downloads (last 30 days) File Size: 20.88 KB File ID: #8849

Graphic Editing Tool

by alex sanchez

 

27 Oct 2005 (Updated 02 Jun 2006)

No BSD License  

Edit plots and text by just selecting them with the mouse. This function allows you to easily move.

Download Now | Watch this File

File Information
Description

Graphic Editing Tool

Usage:
editingtool('On') - enables the function
editingtool('Off') - disenables the function
editingtool - Enables the function if it is Off
              or disenables the function if it is On
              If there is no current figure, a demo is run
editingtool(handles) - enables the function only
                    to the handles specified

Description:
Allows you to edit plots and text by just
selecting them with the mouse.

You can easily move, rotate, change properties etc. of lines
and text by simply clicking on them or typing specific keys.

A double click will select a specific point within a line.

The following Key-Press Functions may used with this program
return - Opens the Java property window of the current object(s)
delete - Deletes the current object(s)
insert - Inserts in additional point to the selected line object
c - copies the current object(s) and places them using the mouse
d - Draw a line by left-clicking on points and right-click when finished
      The Tag property is set to 'line'
p - Draw a polygon by left-clicking on points and right-click when
      finished, the polygon is close with the first point
      The Tag property is set to 'polygon'
t - Insert text by click on a position and typing

Works by setting the ButtonDownFcn of the
current axes and children as editingtool('BtnDown').

NOTES:
The Tag property is useful for extracting the data from the lines
of polygons. For example
  x = get(findobj('Tag','line'),'Xdata')
  y = get(findobj('Tag','polygon'),'Ydata')

The userdata of the figure is set to a structure.
If the userdata already contains a structure,
new fields are added for internal use of the program.
Some of fields are describes bellow
             hAx: Current axes
            hSlc: Handle of line used for point seleccion
            hObj: List of handles of selected objects
          NewObj: Used for pasting
           index: Index of point within a line
            hMod: Handle of object that contains a selected point
          Button: Mouse button selected
    CurrentPoint: [2x3 double] - Last point selected
          hLine: Line drawn during rotation
            Orig: [2x3 double] - Used for rotation of objects

Key Words: Edit, Rotate, Move, Delete, Add Lines, Draw

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
05 May 2006 H. S.  
08 Feb 2007 Guillaume Jacquenot

Excellent work.

I had to change a little the code to have it working with Matlab 6.5.
For previous Matlab versions, you need to modify the beginning of function KeyPress

function KeyPress(hObject, eventdata, handles)
%%J function KeyPress(src,evnt,op)
hFig = get(0,'CurrentFigure');
hAx = get(hFig,'CurrentAxes');
ud = get(hFig,'UserData');
evnt.Key = get(hFig,'CurrentCharacter');
if isempty(ud.hObj) && ~any(strcmpi(evnt.Key,{'d','p','t'}))
    return
end
ud.key = evnt.Key;

04 Jun 2007 f f

Excellent, thank you very much.

03 Jul 2007 ines ben soltana

hi

Please login to add a comment or rating.
Updates
11 Nov 2005

Fixed bugs and added new features

11 Nov 2005

Fixed bugs

29 Nov 2005

fixed bugs and added features

26 Apr 2006

updates, fixed bugs

18 May 2006

can now draw polygons and also handles multiple axis better

30 May 2006

added features

02 Jun 2006

fixed bugs

Tag Activity for this File
Tag Applied By Date/Time
annotation alex sanchez 22 Oct 2008 08:05:01
customization alex sanchez 22 Oct 2008 08:05:01
edit alex sanchez 22 Oct 2008 08:05:01
rotate alex sanchez 22 Oct 2008 08:05:01
delete alex sanchez 22 Oct 2008 08:05:01
move alex sanchez 22 Oct 2008 08:05:01
add lines or polygons alex sanchez 22 Oct 2008 08:05:02
draw alex sanchez 22 Oct 2008 08:05:02
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com