save axes as image
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I have the two codes below for saving plots in my GUI. But first saves just the axes without the labels of axis. The secod saves the figure, which is my whole GUI.
What I would like to do is to save the axes with labels or colorbar or.....
Thanks
1) [file,path]=uiputfile({'*.bmp','BMP'},'Save Image As'); f=getframe(handles.axes); [x,map]=frame2im(f); imwrite(x,fullfile(path, file),'bmp');
2) [file,path]=uiputfile({'*.bmp','BMP'},'Save Image As'); saveas(handles.axes,fullfile(path, file));
0 个评论
采纳的回答
Image Analyst
2012-4-4
Use export_fig ( http://www.mathworks.com/matlabcentral/fileexchange/23629-exportfig) as recommended by 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.).
It will get you the whole figure or just a single axes. Not sure if the colorbar is considered part of the axes though - would need to try saving the axes to check.
2 个评论
更多回答(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!