I need to make a GUI in which you can rotate a surf plot. I currently have a surf plot in my GUI, but I can’t rotate it whatsoever. Clicking it doesn’t work, and it has no menu bar on top of it. Can someone help?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you create a GUI with GUIDE, by default it will remove the toolbar and menubar from the GUI’s figure window, by setting the ‘Toolbar’ and ‘Menubar’ properties of the figure to ‘none’. That’s usually a good thing, as there’s a lot of functionality available in the figure toolbar and menubar that means it’s difficult for you, as the GUI designer, to keep control of the workflow users will experience.
If you just want to make the surf plot rotatable, quickly, you can set the ‘Toolbar’ property of the figure to ‘figure’ using
set(f, 'Toolbar', 'figure')if you have the handlefof the figure, orset(gcf, 'Toolbar', 'figure')if not –gcfis the handle to the current figure.A better way would be to leave the toolbar off, and to maybe add a togglebutton uicontrol labelled “Rotate on/off”. In the callback of this togglebutton, put some code that calls the command
rotate3don the axis of your surf plot to switch rotation on or off. Maybe do the same for panning, zooming as well. That way you can provide rotation while keeping control of the GUI workflow.