File Exchange

image thumbnail

Figure control widget

version 1.5 (4.94 KB) by

Intuitive manipulation of a figure using key and mouse gestures

2 Downloads

Updated

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).
camva(get(cax,'cameraviewangle')*(1+d))

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'));
end

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;
h=figure;
fcw(h,{'pan','rot','zoomz','zoomz'});
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;
h=figure;
surf(peaks(25)); axis equal; axis tight; axis vis3d;
fcw(h,{'pan','rot','zoomz','zoomz'});

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

Kevin

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 http://www.gibboncode.org/?

Kevin

Ketul Patel

cant open the camera?

Tucker McClure

Tucker McClure (view profile)

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.

Updates

1.5

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.

1.4

Added ability to link axes

1.3

Add scroll wheel functionality

1.1

Improved resetting of multiple axes and figures

MATLAB Release
MATLAB 7.14 (R2012a)
Acknowledgements

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