필터 지우기
필터 지우기

save axes as image

조회 수: 2 (최근 30일)
M
M 2012년 4월 4일
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));

채택된 답변

Image Analyst
Image Analyst 2012년 4월 4일
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
M
M 2012년 4월 5일
thanks it worked!
Oliver Woodford
Oliver Woodford 2012년 4월 9일
The colorbar is considered part of the parent axes.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by