2021-10-30
作者:互联网
解决matlab导出figure分辨率改变以及白边问题
set(gcf,‘PaperPositionMode’,‘auto’);
set(gcf,‘Position’,[x_position_screen,y_position_screen,
wid_picture,high_picture]);
%x_position_screen,figure在屏幕的位置;wid_picture,图片的宽
set(gca,‘Position’,[x_position_window y_position_window x_scale y_scale])
%x_position_window,图片在画布中的位置;x_scale,图片在画布中的缩放比例
f=getframe(gca);
f.cdata = imresize(f.cdata,[high_picture,wid_picture]);
imwrite(f.cdata,‘D:\data\test.png’) %直接保存figure,可调分辨率和白边
标签:10,set,figure,picture,30,wid,2021,position,scale 来源: https://blog.csdn.net/zybodidi/article/details/121047754