Hi MATLAB community,
I have a problem with figure sizes.
I want to create many figures and then reposition them across my display.
(if there is any better way to write code in here please tell me)
function Fig = FigureAdvanced2
ScreenInfo = get(0,'ScreenSize');
ScreenWidth = ScreenInfo(3);
ScreenHeight = ScreenInfo(4);
FigWidth = 560;
FigHeiht = 420;
Border = 40;
FiguresPerRow = floor((ScreenWidth - Border)/(FigWidth+Border));
FiguresPerColumn = floor((ScreenHeight - Border)/(FigHeiht+Border));
FigCount = length(findobj('type','figure'));
Fig = figure(FigCount + 1);
FigRow = ceil(Fig/FiguresPerRow);
FigColumn = Fig - (FigRow-1)*FiguresPerRow;
set(Fig,'Position',[FigColumn*Border + (FigColumn - 1)*FigWidth,...
ScreenHeight - FigRow*Border - FigRow*(FigHeiht - 1),...
FigWidth, FigHeiht]);
end
Since FigWidth and FigHeiht are constant in each call, i should get figures of the same size every time, right? Well I don't.
Any help appreciated!
I have a problem with figure sizes.
I want to create many figures and then reposition them across my display.
(if there is any better way to write code in here please tell me)
function Fig = FigureAdvanced2
ScreenInfo = get(0,'ScreenSize');
ScreenWidth = ScreenInfo(3);
ScreenHeight = ScreenInfo(4);
FigWidth = 560;
FigHeiht = 420;
Border = 40;
FiguresPerRow = floor((ScreenWidth - Border)/(FigWidth+Border));
FiguresPerColumn = floor((ScreenHeight - Border)/(FigHeiht+Border));
FigCount = length(findobj('type','figure'));
Fig = figure(FigCount + 1);
FigRow = ceil(Fig/FiguresPerRow);
FigColumn = Fig - (FigRow-1)*FiguresPerRow;
set(Fig,'Position',[FigColumn*Border + (FigColumn - 1)*FigWidth,...
ScreenHeight - FigRow*Border - FigRow*(FigHeiht - 1),...
FigWidth, FigHeiht]);
end
Since FigWidth and FigHeiht are constant in each call, i should get figures of the same size every time, right? Well I don't.
Any help appreciated!