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

1 visualización (últimos 30 días)
Gustav Lindstrand
Gustav Lindstrand el 25 de Nov. de 2016
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.

Respuestas (0)

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by