File Exchange

image thumbnail


version (8.79 KB) by Igor
zoom / pan / rotate / datacursor hotkeys for a figure

1 Download

Updated 05 Jun 2016

GitHub view license on GitHub

* Allows to toggle zoom / pan / rotate / datacursor
* Adds "zoom with mousewheel" to "pan" mode
* Said functionality does not disappear when corresponding buttons are clicked on the figure toolbar
(in contrast with a naive approach)
* Provides an example of a workaround on how to fix 'KeyPressFcn' beeing overwritten when cursor mode changes

* 'z' - toogles zoom mode ( last used of zoom-in and zoom-out - assumes
that mouse wheel is used to change the zoom level )

* 'x' - toggles pan mode. Also adds zooming-with-mouse-wheel.

* 'c' - toggles rotation mode

* 'v' - toggles datacursor mode

Try the demo:
>> figkeys.demo_imshow()

or try it on your own figure like this:
>> imshow('peppers.png'); figkeys.setHotkeys();

Cite As

Igor (2020). i3v/figkeys (, GitHub. Retrieved .

Comments and Ratings (2)


Saved my time:)
- but I have the same problem with other hotkeys..

Blue Bird

Works really great!

The only problem I have is that after enabling the data cursor tool using the hotkey, the normal hotkeys (arrows for move left/right, del for delete) stop working, because the callbacks are rerouted to listen for the hotkey.

I tried to find a workaround, but I couldn't. Do you think it's possible?


Updated submission icon-2

Updated submission icon

Improved description

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux