Can't open figure when saving with 'saveas',

조회 수: 1 (최근 30일)
Gustav Lindstrand
Gustav Lindstrand 2016년 11월 25일
I'm saving a figure as a .png and a .fig file. It generates the files, and the png file works fine to open, but I am unable to open the .fig-file (neither through importing it using the file menu or double clicking it). Here is the part of my code which saves the plot:
scplot=figure('Visible','off');
saveas(scplot,[paths{1} '\Flood Frequency Analysis Files\' today '\' sheets{n} '\Scatter_plot_of_annual_max_' sheets{n} '_Matlab_Plot.fig'])
saveas(scplot,[paths{1} '\Flood Frequency Analysis Files\' today '\' sheets{n} '\Scatter_plot_of_annual_max_' sheets{n} '_Image.png'])
The paths are a bit messy, but the files are saves in the right Place with the right format, and as I said the second saveas returns a functioning .png image.
I've tried using savefig instead of saveas and it gave the same error. Using saveas or savefig in the command line works fine, it's just in my function that it doesn't work.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by