I'm trying to create a multi-page "PDF"
(application/pdf Adobe Acrobat format) file with code similar to this minimum working example code, featuring PlotLegends
and "LargeLabels"
Export["Test.PDF",
CreateDocument[
ExpressionCell[
#
, PageBreakBelow -> True
, WindowSize->All
]& /@ Table[
ListPlot[
Sort/@RandomReal[1,{5,20}]
, Joined -> True
, PlotLegends -> RandomWord[5]
, PlotTheme -> {"Scientific","LargeLabels"}
, PlotLabel -> RandomWord[]
, ImageSize-> 600
]
,{5}
]
]
, "PDF"
]
The image shows the problem: Legends are clipped and the page is portrait instead of Landscape.
I'm struggling to find a good way to programmatically avoid PlotLegends
being clipped, other than changing ImageSize
by trial and error. As pages are created programmatically, checking all by hand is undesirable.
Also, I can't find out how to define the correct page orientation, i.e to force a Landscape page if AspectRatio
$< 1$ and Portrait otherwise.
How can one create a multi-page PDF file with the correct page orientation and avoid clipping PlotLegends
?
ImageSize->600
is 600 printer points but it does not correlate with screen resolution and visible size of the plots.. $\endgroup$