How to automatically increase page size in exportgraphics?

6 次查看(过去 30 天)
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 中查找有关 Printing and Saving 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by