Saving Figure using saveas() function
8 ビュー (過去 30 日間)
古いコメントを表示
Is there any way by which I can save the current figure?.
When I use saveas() function eg)saveas(gcf,'pred_prey.jpg') the current image in the figure gets saved but with a white background with my image centered in it.
I need only the image no need of the white background. How can I do that?
https://picasaweb.google.com/lh/photo/xxof9xl2tRBx0GttFdESBJOzMXS1UfqXPDW9N1lFu0w?feat=directlink
1 件のコメント
Jan
2011 年 2 月 18 日
The link shows a picture, but it does not clear the difference of what you get and waht you want.
採用された回答
Oliver Woodford
2011 年 2 月 18 日
The function export_fig (available on the File Exchange) will automatically crop the image for you. It will not change the background colour, nor will it resize the figure. It will save to jpeg with low compression/high quality by default.
Download it then try:
export_fig(gcf, 'pred_prey.jpg');
0 件のコメント
その他の回答 (2 件)
Doug Hull
2011 年 2 月 18 日
If you have the image as a matrix that you used in IMSHOW, then IMWRITE directly on the matrix should work.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Printing and Saving についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!