How to automatically increase page size in exportgraphics?

11 visualizaciones (últimos 30 días)
mkarikom
mkarikom el 21 de Abr. de 2020
Comentada: mkarikom el 27 de Mayo de 2020
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');

Respuesta aceptada

Nishant Gupta
Nishant Gupta el 27 de Mayo de 2020

Más respuestas (0)

Categorías

Más información sobre Red en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by