keyControlPlugin

版本 1.2.0.0 (5.5 KB) 作者: georg
A figure plugin class usable as keyPress callback Function.
219.0 次下载
更新时间 2011/10/4

查看许可证

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.

引用格式

georg (2024). keyControlPlugin (https://www.mathworks.com/matlabcentral/fileexchange/33112-keycontrolplugin), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2011a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Audio Plugin Creation and Hosting 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.2.0.0

more tags

1.1.0.0

small fix for the help text

1.0.0.0