Code covered by the BSD License  

Highlights from
Keypress Functions for Figures

4.0

4.0 | 1 rating Rate this file 4 Downloads (last 30 days) File Size: 8.67 KB File ID: #12537

Keypress Functions for Figures

by Jeff Dunne

 

04 Oct 2006 (Updated 04 Oct 2006)

KPFUN adds keypress functions to figures

| Watch this File

File Information
Description

KPFUN adds keypress functionality to figures for those little things that one commonly forgets to do when making a plot in the first place. They are all things that are easy enough to do at the command prompt, but this function adds them at the touch of a key.

There are just under one hundred shortcut keys defined, so I won't describe them all here. This was written in release 6.5, so some of them are now not necessarily needed anymore (like panning, for example), but others are still very useful. Some of my favorites are:

* Rescale the colormap to fit the currently viewable area
* Invert axis/change axis styles
* Change line styles/markerstyles
* Steal data from a figure and save it in the base workspace
* Plot horizontal and vertical slices from image data
* Toggle grid
* Add/remove horizontal/vertical colorbars
* Manually modify pieces of the colormap
* Cycle or exchange the colormap
* Increase/descrease font sizes or line widths
* Cycle selected objects on the axes

Since there are so many shortcuts defined, I lose track of the ones I don't use, so this function also contains two aids: 1) The '/' key will result in a flashed message describing what the next key pressed does, and 2) The '?' brings up the KPFUN help info in a separate window. These two features are kind of useful on their own, particularly the internal 'flashmessage' function, which displays a message on the current axes for a short duration and then deletes it. It is an internal function here, but could be grabbed out and used on its own with very little effort.

Suggestions for improvements or additional features are welcome.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
12 Nov 2007 Ahmad Samy

Good but it is difficult to remember all the key functions

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
keypress figure augment shortcut keys Jeff Dunne 22 Oct 2008 08:42:44
keypress figure augment shortcut keys Weng Shao-Hang 03 Jan 2012 07:29:17

Contact us at files@mathworks.com