How to use Camera Toolbar in a MatLab Live Script

Hello,
I have a 3D plot made in a live script that I am getting ready to present to my students. In a normal script, I can make the same figure and go to View > CameraToolbar > Camera Orbit or just click the Rotate3D icon above the figure.
It seems that there is no way to do this in a live script, but I am limited to using live scripts because my university wants students to learn MatLab with the live editor since it allows them to make professional reports easily.
Does anyone have any suggestions?

 Accepted Answer

You can pop the figure out of a live script. To do this, either 1) hover over the figure in the live script and click the 'Open in figure window'
or add the code figure('Visible','on') to the top of your plotting code.

12 Comments

That doesn't quite accomplish what I want. When I pop the figure out, and manually adjust the figure, I can't keep those adjustments in the live editor.
Apologies. I thought you just wanted the figure window popped out. You get the same figure toolbar in a live script. Try clicking on the figure in the live script output then hovering over the top right of it. The figure toolbar should appear, and 'rotate3D' will be one of the options.
Hmm, I'll check again. But I don't remember that being available in 2020b.
I can confirm it is there in R2020b, though it can sometimes take a couple mouse movements to get the toolbar to appear.
See this answer as well.
Sorry to disappoint, but it is not showing up when I follow the recommended steps in that answer.
Here is my 3D rotated plot after opening outside the live-editor.
But here is all that shows up in the top corner of the live editor. I couldn't keep the realease in the cropped image, but it is R2020b. I even tried the enableDefaultInteractivity function with the appropriate axes and it did not work.
How do you create your plot? I notice I only see it on 3D plots and only when I don't use view(2).
And view(2)? I'm wondering why it initially looks like a 2D plot (your 2nd screenshot here).
Sorry, didn't realize you were asking me to try view(2).
view(3) gives the necessary results. For my purposes the yaxis is labeled z.
Thanks
Glad that works.
About view(2), I was just checking that you weren't using it because the rotate3D option won't be there if you do.
To be fair, I didn't either, but discovered that while I was trying to duplicate your issue.

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Products

Release

R2020b

Community Treasure Hunt

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

Start Hunting!