File Exchange

image thumbnail

Figure control widget

version (4.94 KB) by Oliver Woodford
Intuitive manipulation of a figure using key and mouse gestures

1 Download

Updated 22 Jul 2015

View Version History

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.

Cite As

Oliver Woodford (2020). Figure control widget (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (10)

W Ryan Williamson

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

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

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

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.

Thomas Weibel

Good stuff.

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

Inspired by: view3d.m, Figure Rotator

Inspired: View Contol Widget

Community Treasure Hunt

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

Start Hunting!