Code covered by the BSD License  

Highlights from
Figure control widget

5.0
5.0 | 4 ratings Rate this file 31 Downloads (last 30 days) File Size: 4.94 KB File ID: #38019 Version: 1.5

Figure control widget

by

 

05 Sep 2012 (Updated )

Intuitive manipulation of a figure using key and mouse gestures

| Watch this File

File Information
Description

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.

Acknowledgements

View3d.M, Camview, and Figure Rotator inspired this file.

This file inspired View Contol Widget.

Required Products MATLAB
MATLAB release MATLAB 7.14 (R2012a)
MATLAB Search Path
/
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
15 Apr 2015 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.

Comment only
14 Apr 2015 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

Comment only
14 Apr 2015 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

Comment only
14 Apr 2015 Oliver Woodford

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

Comment only
14 Apr 2015 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

02 Oct 2013 Ketul Patel

cant open the camera?

Comment only
18 Jan 2013 Tucker McClure

Tucker McClure (view profile)

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

12 Sep 2012 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.

06 Sep 2012 Thomas Weibel

Good stuff.

Updates
06 Sep 2012 1.1

Improved resetting of multiple axes and figures

18 Jan 2013 1.3

Add scroll wheel functionality

29 Apr 2015 1.4

Added ability to link axes

22 Jul 2015 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.

Contact us