Code covered by the BSD License  

Highlights from
LINECMENU

5.0

5.0 | 1 rating Rate this file 13 Downloads (last 30 days) File Size: 6.37 KB File ID: #30989
image thumbnail

LINECMENU

by Matt Fig

 

07 Apr 2011 (Updated 13 Apr 2011)

Utility for creating a standard uicontextmenu for line objects.

| Watch this File

File Information
Description

LINECMENU Creates a uicontextmenu or submenu to a pre-existing uicontextmenu for a line object.
U = LINECMENU; creates a uicontext menu for a line object. U can then be
put in the 'uicontextmenu' property of any (or several) line object(s).
 
LINECMENU(H) appends a line menu to uicontextmenu or submenu in handle H.

The sample image shows the menu which comes up when a line is clicked.

The code should be easy enough to follow that it is extensible. For
example, one could add more sizes to the MarkerSize menu by following the
pattern laid out in the code.

Also included is another M-file, DEFAULTLINECREATEFCN. This file is meant to be called from the STARTUP file so that LINECMENU is automatically placed in the uicontextmenu for all subsequently created lines. This is optional, and will result in all future lines created by the user having the LINECMENU options. The directions for performing this simple, optional operation are included in the help for DEFAULTLINECREATEFCN. If you want to do this and are unable to figure it out, feel free to contact me and I will help you.

Also included is a bonus function, DUALCOLORPLOT. This function uses LINECMENU, and so serves as a demo for LINECMENU. DUALCOLORPLOT was inspired by a recent post on Doug Hull's video page.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
12 Apr 2011 Oleg Komarov

This submission should be implemented as standard matlab functionality.
I would also add 'more' under markersize and linewidth to allow user specified size.

13 Apr 2011 Matt Fig

Great idea Oleg, thanks! I have submitted an update.

Please login to add a comment or rating.
Updates
07 Apr 2011

Abandoned nested functions in bonus file.

11 Apr 2011

Added the optional default file.

13 Apr 2011

Implemented Oleg's suggestions.

Tag Activity for this File
Tag Applied By Date/Time
uicontextmenu Matt Fig 07 Apr 2011 15:29:25
uimenu Matt Fig 07 Apr 2011 15:29:25
line Matt Fig 07 Apr 2011 15:29:25
plot Matt Fig 07 Apr 2011 15:29:25
dualcolorplot Matt Fig 07 Apr 2011 15:29:25
utility Matt Fig 13 Apr 2011 10:52:55
style Jan Simon 07 Oct 2011 05:43:48

Contact us at files@mathworks.com