How to load existing figure into GUIDE UIAxes

8 views (last 30 days)
I have an image with plots and labels layered on top that has been saved as both a .fig and a .jpg. My app loads the picture to display it, but the .jpg images are too blurry.
How do I load an existing .fig file into a UIAxes element? I already have the image saved as a property using openfig
  4 Comments
Adam Danz
Adam Danz on 15 Apr 2021
Juan Pablo Pérez Durán's answer moved here as a comment
Did you find out how to? I'm struggling with the same thing:(
Adam Danz
Adam Danz on 15 Apr 2021
As Adam mentioned above, you'll either need to copy all of the axis elements to the uiaxes
copyobj(ax.Children, app.UIAxes)
or completely replace the app axes with the axes from the external figure
newax = copyobj(ax, app.UIFigure);
and then reposition the copied axes, then delete the uiaxes
set(newax,'Units',app.UIAxes.Units,'Position',app.UIAxes.Position) % and possibily other properties
As Adam mentioned, this can get messy and my lines above are the untested bare minimum.

Sign in to comment.

Answers (0)

Categories

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

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!