altmany / export_fig

A MATLAB toolbox for exporting publication quality figures
BSD 3-Clause "New" or "Revised" License
1.28k stars 368 forks source link

export_fig error #331

Closed economicsstudent closed 3 years ago

economicsstudent commented 3 years ago

Hi, have done as advised, that is, installed the 2020 version of export fig though the following error appears even if installation seems to be correct. however Matlab seems to pick up shadow versions of the previous export fig. Previous versions of this application have been removed from the folder. How can it be ensured that no mistakes in export fig´s expected input arguments are made? How can shadow versions of exportfig be removed? Many thanks for your assistance!

export_fig error. Please ensure:
 * that the function you used (C:\Program Files\MATLAB\R2017b\VAR\VAR-Toolbox-main\v3dot0\ExportFig2020\export_fig.m) version 3.14 is from the expected location
    (you appear to have multiple versions of export_fig installed)
Error in VARToolbox_Primer (line 60)
SaveFigure('graphics/DATA_GK',1)

C:\Program Files\MATLAB\R2017b\VAR\VAR-Toolbox-main\v3dot0\ExportFig2020\export_fig.m
C:\Program Files\MATLAB\R2017b\VAR\VAR-Toolbox-main\OldVersions\v2dot0\ExportFig\export_fig.m  % Shadowed
C:\Program Files\MATLAB\R2017b\VAR\VAR-Toolbox-main\v3dot0\ExportFig\export_fig.m              % Shadowed

 * and that you did not made a mistake in export_fig's expected input arguments
 * and that ghostscript is properly installed in C:\Program Files\MATLAB\R2017b\VAR\VAR-Toolbox-main\v3dot0\gs9.53.3\bin\gswin32c.exe

If the problem persists, then please report a new issue.
In your report, please upload the problematic EPS file: C:\Users\HP\AppData\Local\Temp\tp1ed19231_440c_4563_a5f0_edc7ac650366.eps (you can then delete this file).

Error using export_fig (line 929)
Could not create graphics/DATA_GK.pdf - perhaps the folder does not exist, or you do not have write permissions, or
the file is open in another application

Error in SaveFigure (line 31)
    export_fig(path,['-' type],'-painters')

Error in VARToolbox_Primer (line 60)
SaveFigure('graphics/DATA_GK',1)
altmany commented 3 years ago

To remove the two old (shadowed) versions of export_fig, you can either rename them or remove their folder from the Matlab path. In any case, this is probably not the underlying cause of your error, since (presumably) the unshadowed version is the latest one. The underlying problem is (as clearly stated) that Matlab Could not create graphics/DATA_GK.pdf - perhaps the folder does not exist, or you do not have write permissions, or the file is open in another application. You should check why that is (perhaps there's no graphics subfolder for example?).

In any case, I don't see a program bug here, but rather a usage error, so I'm closing the issue.