can not open fig files saved by "saveas" after live script ran

Hi, everyone. I encountered a problem in Matlab2019b these days.
I want to save the .fig files and .eps files after the live script done with
saveas(gcf,'path/fig_name','fig')
print(gcf,'path/fig_name','-r300','-depsc')
Everyting is fine with those .eps files. However, those fig files were also saved but I just can't open them.
If I select the plotting commands, press F9 run them again, replot the figures in private windows as .m script do, then those saved fig files can be opened with matlab.
Any advice will be appreciated.
Thx!

4 Comments

What happens when you try to open them?
What happens if you specifically call openfig() passing in the file name?
I double clicked the fig files nothing happened. In matlab, I open those file with open->select the files, nothing happened. Let me try your second advice and reply you soon. Thx!
Hi Roberson,
I still can't open them and got these information from openfig():
>> openfig('1t6e7_85Hfluxc17.fig')
ans =
Figure (LiveEditorRunTimeFigure) - 属性:
Number: 3
Name: ''
Color: [1 1 1]
Position: [680 672 560 420]
Units: 'pixels'
显示 所有属性
Alphamap: [1×64 double]
BeingDeleted: 'off'
BusyAction: 'queue'
ButtonDownFcn: ''
Children: [2×1 Graphics]
Clipping: 'on'
CloseRequestFcn: 'closereq'
Color: [1 1 1]
Colormap: [256×3 double]
CreateFcn: ''
CurrentAxes: [1×1 Axes]
CurrentCharacter: ''
CurrentObject: [0×0 GraphicsPlaceholder]
CurrentPoint: [0 0]
DeleteFcn: ''
DockControls: 'on'
FileName: 'C:\path\1t6e7_85Hfluxc17.fig'
GraphicsSmoothing: 'on'
HandleVisibility: 'on'
InnerPosition: [680 672 560 420]
IntegerHandle: 'on'
Interruptible: 'on'
InvertHardcopy: 'on'
KeyPressFcn: ''
KeyReleaseFcn: ''
MenuBar: 'figure'
Name: ''
NextPlot: 'add'
Number: 3
NumberTitle: 'on'
OuterPosition: [672 664 576 507]
PaperOrientation: 'portrait'
PaperPosition: [0 0 15 9.2700]
PaperPositionMode: 'manual'
PaperSize: [21.0000 29.7000]
PaperType: 'A4'
PaperUnits: 'centimeters'
Parent: [1×1 Root]
Pointer: 'arrow'
PointerShapeCData: [16×16 double]
PointerShapeHotSpot: [1 1]
Position: [680 672 560 420]
Renderer: 'opengl'
RendererMode: 'auto'
Resize: 'on'
Scrollable: 'off'
SelectionType: 'normal'
SizeChangedFcn: ''
Tag: 'LiveEditorRunTimeFigure'
ToolBar: 'auto'
Type: 'figure'
UIContextMenu: [0×0 GraphicsPlaceholder]
Units: 'pixels'
UserData: []
Visible: 'off'
WindowButtonDownFcn: ''
WindowButtonMotionFcn: ''
WindowButtonUpFcn: ''
WindowKeyPressFcn: ''
WindowKeyReleaseFcn: ''
WindowScrollWheelFcn: ''
WindowState: 'normal'
WindowStyle: 'normal'
Sounds like this figure was generated in LiveEditor based on 'LiveEditorRunTimeFigure' which is why it was not visible.

Sign in to comment.

 Accepted Answer

fig = openfig('1t6e7_85Hfluxc17.fig');
fig.Visible = 'on';
That is, that your figures are being created, but their visibility is set to off.

More Answers (0)

Categories

Find more on Update figure-Based Apps in Help Center and File Exchange

Products

Release

R2019b

Asked:

on 27 Jul 2020

Commented:

on 22 Apr 2021

Community Treasure Hunt

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

Start Hunting!