File Exchange

image thumbnail

Figure control widget

version 1.5 (4.94 KB) by

Intuitive manipulation of a figure using key and mouse gestures



View License

Especially useful for 3d renderings, this widget allows the user to intuitively rotate, pan and zoom any axes within a figure using key presses and mouse gestures. Additionally, link several axes to move synchronously, press q to quit the widget, r (or double-click) to reset the current axes and escape to close the figure.

Comments and Ratings (10)

Great program
I had to add the following code immediately after the camdolly function is called in order to get the fcw_zoomz to work though (after line 352).

Oliver Woodford

Kevin: I designed fcw to be called on a figure once all the axes have been created and populated. The behaviour on axes that are created after fcw is called is undefined. I should put this in the help text.

Kevin Moerman

Kevin Moerman (view profile)

It appears fixed by pressing 'r' i.e. reset which can also be achieved through:
% Reset all the axes
for h = findobj(fig, 'Type', 'axes','-depth',1)'
camview(h, get(h, 'UserData'));

Kevin Moerman

Kevin Moerman (view profile)

Thanks Oliver. Not sure if the following is a bug, but I tried to call fcw before actually plotting anything in the figure window e.g.:

clear; close all; clc;
surf(peaks(25)); axis equal; axis tight; axis vis3d;

That works, but if I leave out "axis vis3d" this will pan and zoom at the same time for left click. This effect is also gone if I use:

clear; close all; clc;
surf(peaks(25)); axis equal; axis tight; axis vis3d;

i.e. call fcw after actually plotting something (fcw probably turns axis vis3d on as well?).


Oliver Woodford

Kevin: Yes! Please retain the license & copyright info etc. and label it as included on the GIBBON fex page. Thanks.

Kevin Moerman

Kevin Moerman (view profile)

Can't believe I stuck with the standard view manipulation for so long. This is great stuff! Could I add this to


Ketul Patel

cant open the camera?

Tucker McClure

Smooth and easy to use. I like that the right button pans.

Sam Johnson

This widget is absolutely fantastic - rotation of 3D data is far more intuitive than with the default controls. I no longer visualise any 3D data without it. Thank you.

Good stuff.



This update allows the method to block, be ignored when modifier keys are pressed, and pass on mouse gestures and button presses to other callbacks.


Added ability to link axes


Add scroll wheel functionality


Improved resetting of multiple axes and figures

MATLAB Release
MATLAB 7.14 (R2012a)

Inspired by: view3d.m, Figure Rotator

Inspired: View Contol Widget

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video