i can't save my plot as a png

23 views (last 30 days)
hi guys,
i've made a plot (errorbar plot to be precise) and i get it looking exactly as i want, but when i give MatLab the command
saveas(gcf,'ErrorPlot.png')
i get the following errors:
Error using matlab.graphics.internal.name (line 112)
Cannot create output file './ErrorPlot.png'.
Error in print (line 71)
pj = matlab.graphics.internal.name( pj );
Error in saveas (line 181)
print( h, name, ['-d' dev{i}])
can someone please help me?

Accepted Answer

Walter Roberson
Walter Roberson on 25 May 2022
You are cd to a directory that you do not have write access to. In particular you might be cd to the matlab installation directory.
  2 Comments
Adam Jurhs
Adam Jurhs on 25 May 2022
ahhhh, ok thanks! i'm a newbie so i'm learning these things
Adam Jurhs
Adam Jurhs on 25 May 2022
yep, i opend MatLab in my home directory, ran the code and it saved the plot as a png, thanks!

Sign in to comment.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!