How to load an existing .fig on live editor and show it as an output?

조회 수: 5 (최근 30일)
I want to load an existing Matlab figure to my Live Editor script and show it as an output in the same way that it would appear if I used, for example, the plot function.
I've tried using openfig and setting it to visible, but the figure pops out in a new window instead of appearing as an output. Is there something I'm missing?

채택된 답변

Walter Roberson
Walter Roberson 2018년 12월 30일
No, you are not missing anything. MATLAB does some funky things internally, and is somehow able to distinguish the two cases.
Saved "traditional" figures and figures in LiveScript both are class matlab.ui.Figure . But in R2018b (subject to change)
  • the LiveScript version has additional figure field AutoListeners__
  • the LiveScript version sometimes has additional figure field InternalEditor_Data
  • LiveScript figure has NodeChildren of class matlab.graphics.primitive.canvas.JavaCanvas, traditional is matlab.graphics.Graphics
  • LiveScript figure ApplicationData.EDITOR_APPDATA is a non-empty struct; traditional figure ApplicationData.EDITOR_APPDATA is empty struct;
  • axes in traditional version has additional field HardwareCallbackListener
  • axes in LiveScript version has empty Interactions.Canvas and Interactions.Figure and Interactions.List and Interactions.NumDataSpaces; traditional axes has matlab.graphics.primitive.canvas.JavaCanvas and matlab.ui.Figure and matlab.graphics.interaction.internal.InteractionsList and value 1, respectively.
There are some minor property differences that are irrelevant, such as Toolbar 'none' vs 'auto'.
The way that canvases are handled is probably the most important part.

추가 답변 (1개)

Arun Kumar Bar
Arun Kumar Bar 2018년 12월 29일
If I have understood well, what you could do is, open the figure and click on the 'Show Plot Tools and Dock Figure' icon. Hope it will lead to what you are looking for.
Cheers!
Arun

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by