Adjust size of a figure in MATLAB based on the screen size.


Code

fig = figure(); clf; scrsz = get(0,'ScreenSize'); 

xstart = 0.2;

ystart = 0.2;

xsize  = 0.7;

ysize  = 0.6;

set(fig,'Position', [xstart*scrsz(3), ystart*scrsz(4), xsize*scrsz(3), ysize*scrsz(4)]);

imagesc(rand(100, 100)); colormap bone;

axis off; axis square;

title(sprintf('xstart: %.1f ystart: %.1f xsize: %.1f ysize: %.1f', xstart, ystart, xsize, ysize), 'FontSize', 20);


신고

'Enginius > Matlab' 카테고리의 다른 글

KOSROBOT 2015 그루핑에 사용된 매트랩 코드  (0) 2015.07.05
MATLAB 책  (0) 2015.06.23
Figure size setting based on screen size  (0) 2015.04.09
Fast implementation of kdpp  (0) 2015.04.02
Kinect 사용하기 2  (1) 2014.12.26
Spline Fitting  (0) 2014.12.22
« PREV : 1 : ··· : 111 : 112 : 113 : 114 : 115 : 116 : 117 : 118 : 119 : ··· : 581 : NEXT »