필터 지우기
필터 지우기

Save figures in png format

조회 수: 3 (최근 30일)
Alessandro D
Alessandro D 2022년 2월 23일
답변: DGM 2022년 2월 23일
In order to save a plot in png format I use the following:
print(fullfile(FigDir,'firmSize'),FormatFig)
where FormatFig='-dpng' and FigDir specifies the directory where to save the plot. However the plot is not saved full screen: it is saved exactly as it is shown in the window that automatically pops up after executing the command plot. Then I have to manually make the plot full screen and then I save it. Is there a way to do this in the code instead of doing it manually?
Thanks!

답변 (1개)

DGM
DGM 2022년 2월 23일
This lists multiple methods to maximize a figure window. The suggestions depend on version and environment, so take note of that.
x = linspace(-10,10,101);
y1 = sinc(x);
hf = figure;
plot(x,y1)
hf.WindowState = 'maximized';

카테고리

Help CenterFile Exchange에서 Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by