How to automatically increase page size in exportgraphics?

조회 수: 9 (최근 30일)
mkarikom
mkarikom 2020년 4월 21일
댓글: mkarikom 2020년 5월 27일
I have the following code, which creates the attached image:
f = figure('visible','off');
t = tiledlayout(1,2,'Padding','none','TileSpacing','compact');
t.Units = 'centimeters';
t.OuterPosition = [0.1 0.1 22 9];
nexttile;
heatmap(denormPrimaryGrid,denormSecondaryGrid,gridProbs,...
'CellLabelColor','none',...
'Colormap',flipud(redgreencmap));
ax = gca;
ax.FontSize = 5;
nexttile;
heatmap(denormPrimaryGrid,denormSecondaryGrid,gridProbs,...
'CellLabelColor','none');
ax = gca;
ax.FontSize = 5;
exportgraphics(t,'orig.pdf','BackgroundColor','none','ContentType','vector');
I'd like to enlarge this a bit, so make the following code changes and re-export. But matlab refuses to change the size and just chops off left side:
f = figure('visible','off');
t = tiledlayout(1,2,'Padding','none','TileSpacing','compact');
t.Units = 'centimeters';
t.OuterPosition = [0.1 0.1 27 12];
nexttile;
heatmap(denormPrimaryGrid,denormSecondaryGrid,gridProbs,...
'CellLabelColor','none',...
'Colormap',flipud(redgreencmap));
ax = gca;
ax.FontSize = 5;
nexttile;
heatmap(denormPrimaryGrid,denormSecondaryGrid,gridProbs,...
'CellLabelColor','none');
ax = gca;
ax.FontSize = 5;
exportgraphics(t,'orig.pdf','BackgroundColor','none','ContentType','vector');

채택된 답변

Nishant Gupta
Nishant Gupta 2020년 5월 27일

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by