How to get MATLAB zoom context menu "Reset to Original View" to work on a 3D plot?

I have several plots on one figure. One is a 3D plot, the rest are 2D. When I select Zoom on the toolbar, left clicking on the mouse uses the zoom.m functions, and in 3D, it looks like it uses camzoom.m. However, when I right click to bring up the context menu, the "Reset to Original View" looks like it only works on the 2D plots. For the 3D plot, selecting this either does nothing or it loses the x-axis limits, and therefore the plot shows no data points (I can't get it to work consistently).
I'm trying to come up with a workaround for this problem.
I would like to override the context menu for just the 3D plot with my own function that would redraw the plot, and leave the default context menu for the 2D plots. Is this possible? I'm thinking no, as there is only one zoom object for the entire figure, and MATLAB does not let me set the handle to the context menu while zoom is on.
Is there a way to get around this problem? It looks like an oversight on MATLAB's part to not have this function correctly!
Thanks,
Amy

1 Comment

Update: I tried "Reset to Original View" with a single 3D plot on a single figure, and this works. So, this problem may be related to the fact that I have a mix of plots on one figure?

Sign in to comment.

Answers (1)

just after ploting 3D
set(gcf,'menubar','none')

1 Comment

Thanks for replying. However, doesn't this turn off the menus? I don't want to turn off the menus, the users want the "Reset to Original View" function available, since zoom can be difficult at times to control.

Sign in to comment.

Categories

Asked:

Amy
on 12 Sep 2012

Community Treasure Hunt

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

Start Hunting!