How do I display Tiled Layouts properly?

2 visualizaciones (últimos 30 días)
Chad
Chad el 10 de Nov. de 2022
Respondida: Jeff Miller el 10 de Nov. de 2022
I'm trying to display a collection of CFD plots using a tiled layout and I want to print it directly to PDF in-code, but when I do that the proportions of everything comes off terribly wrong. Here's the code I'm using...
figure(1)
t = tiledlayout(4,2,"TileSpacing","loose","OuterPosition",[0 0 1 1],"Padding","compact");
%bunch of nexttiles for plots
title = "Mach "+Mo+" Number"+".pdf"
exportgraphics(t,title)
And this is what I get:
But if I open the tiled layout directly from the figure view in MatLab, it turns out the way it should, as such:
Obviously, I could just copy and paste all day, but I need to do this iteratively. How can I adjust the settings so that it outputs to pdf properly? Thanks in advance!

Respuestas (1)

Jeff Miller
Jeff Miller el 10 de Nov. de 2022
I haven't used tiled layouts yet so this may be way off-base, but something like the following has solved similar scaling problems for me:
f1 = figure(1);
% whatever you want to draw the figure
title = "Mach "+Mo+" Number"+".pdf"
print(f1,title,'-dpdf','-bestfit');

Categorías

Más información sobre Computational Fluid Dynamics (CFD) 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