Contour Plot to Image.jpg
6 ビュー (過去 30 日間)
古いコメントを表示
Hello!
I need to know how to save or export a 2D Contour plot into an Image file (preferible with .jpeg extension).
I would like also to be able to specify the output location (the folder where the image will be saved), I have tried with this:
contourf(xx,yy,turbul_interp);
xlabel('AXIS X')
ylabel('AXIS Y')
hgsave('name_of_my_image');
But then it appears the following error message:
??? Error using ==> save
Unable to write file name_of_my_image.fig: permission denied.
Any idea about how to do it?. Thanks!
2 件のコメント
Geoff Hayes
2014 年 12 月 30 日
Peter - do you have write permissions in the folder where you are trying to create the file? Try specifying the folder name as well...
採用された回答
Image Analyst
2014 年 12 月 30 日
I would not use jpg format. I never create JPEG images. JPEG can/will degrade your image. Use PNG instead.
What does this report in the command window if you call it just before hgsave:
pwd
You probably can't save to that folder.
Anyway, even if you get that solved, I'd take a look at the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_save_my_figure.2C_axes.2C_or_image.3F_I.27m_having_trouble_with_the_built_in_MATLAB_functions.
7 件のコメント
Sean de Wolski
2014 年 12 月 30 日
To be fair, in R2014b and newer, I'm not all that convinced that it's necessary. Print has gotten a lot better.
その他の回答 (1 件)
Sean de Wolski
2014 年 12 月 30 日
You need to save it somewhere else or have write-permissions for that directory. You could change the directory settings, or run MATLAB as an admin (on Windows right-click the icon, run as admin).
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Downloads についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!