Be the first to rate this file! 2 Downloads (last 30 days) File Size: 5.47 KB File ID: #33112
image thumbnail

keyControlPlugin

by georg

 

03 Oct 2011 (Updated 04 Oct 2011)

A figure plugin class usable as keyPress callback Function.

| Watch this File

File Information
Description

A simple key-control plugin for plot figures

KEYCONTROLPLUGIN is a simple class whose 'KEYPRESSFUNCTION' method can be used as a KeyPressCallback function for plot figures in order to add basic key-enabled scrolling and zooming functionality.
 
    Usage example:
      t = 0:0.01:100 ;
      y = sin(t) ;
      c = keyControlPlugin('scrollFactor',0.25) ;
      plot(t,y) ;
  set(gcf,'KeyPressFcn',@c.keyPressFunction)
 
For more examples see the attached TESTPLOTCONTROL script.
 
Use this plugin in combination with LINKAXES in order to control
multiple plot figures, see examples
 
Options: (key-value style)
  ydisabled: [ false | true ], default: false
  zoomFactor: [ 0.1 ... 0.9 ], default: 0.5
  scrollFactor: [ 0 ... 1 ], default: 0.5
 
These keys are available in the current version:
  h ... list of available commands
  n ... next slice (jump by scrollFactor)
  b ... backwards (jump by scrollFactor)
  i ... zoom in (visiblerange = visiblerange*zoomFactor)
  o ... zoom out (visiblerange = visiblerange*(1+zoomFactor))
 
These modifiers are available
  Shift n ... jump to the beginning
  Shift b ... jump to the end
  Shift i ... zoom in (fast mode)
  Shift o ... show entire axis range
  Alt <COMMAND> ... apply any command to the y-axis
  AltShift <COMMAND> ... apply shift command to y-axis
 
Known issues:
  - In case the figure is not in default mode, the plugin may fail; it may even fail to be initialized. You will either notice no change or see a warning message. Use figure(...,'ToolBar','none')
in case you won't use the mouse anyway.

MATLAB release MATLAB 7.12 (R2011a)
Tags for This File  
Everyone's Tags
callback function, data exploration, signal processing, user interface, visualization
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
03 Oct 2011

small fix for the help text

04 Oct 2011

more tags

Contact us