How to subplot figures reopened from .fig files correctly when they containing images?
1 view (last 30 days)
I have some saved figures, mostly containing images (imshow) and lines plotted to them. I would like to display them in a subplot after opening them again.
I was trying the copyobj-related suggestions here in the forum, but they don't work well in this situation. The problems are:
- Images are displayed upside down
- The out-of-image parts of the lines appearing in the subplot
- Aspect ratio changes
When I just reopen the .fig files and display them individually as separate figures there is no problem, it displays well.
Could anybody help me, how to display the subplots to look like the original figures?
Constantino Carlos Reyes-Aldasoro on 8 Oct 2020
What you have to do is to grab each element by its handles, to grab the handles of a figure you use
then you can access the fields, i.e.
Alphamap: [1×64 double]
Children: [1×1 Axes]
Color: [0.9400 0.9400 0.9400]
Colormap: [64×3 double]
CurrentAxes: [1×1 Axes]
CurrentObject: [0×0 GraphicsPlaceholder]
CurrentPoint: [0 0]
InnerPosition: [960 230 560 420]
OuterPosition: [952 222 576 513]
PaperPosition: [3.0917 9.2937 14.8167 11.1125]
PaperSize: [21.0000 29.7000]
Parent: [1×1 Root]
PointerShapeCData: [16×16 double]
PointerShapeHotSpot: [1 1]
Position: [960 230 560 420]
UIContextMenu: [0×0 GraphicsPlaceholder]
In this case I had one subplot so the children is just one axes, but if it were more, it would show, you can then grab the handles of the children like this
Axes with properties:
XLim: [0 0.0600]
YLim: [0 0.1000]
Position: [0.1300 0.1100 0.7750 0.8150]
Show all properties
And now h1 can be used to manipulate that axis, look at the position. If you had more children then you can grab each and manipulate as necessary.
Hope this answers your problem.