3
$\begingroup$

Sometimes I want to Export a collection of plots or other Graphics to a pdf in A4 format. Right now I'm using a GraphicsGrid inside a panel which is an inset in a Graphics object. Here is an example:

    Module[{plot},
   plot := ListPlot[RandomInteger[{0, 10}, 10], ImageSize -> 400];
   Graphics[{Inset[
      Panel[GraphicsGrid[{{plot, plot}, {plot, plot}, {plot, 
          plot}}], {Style["Title\n", Directive[20, Bold]]}, {Top}, 
       Background -> White], ImageScaled[{0.52, 0.5}]]}, 
    ImageSize -> {210*5, 297*5}]
   ] // Set[visu, #] &;

visu // Print;

This solution looks rather convoluted to me. Is there a better way to create a pdf containing these plots?

$\endgroup$

1 Answer 1

1
$\begingroup$

If you want an overall page title and a different label on each subfigure:

Column[
 {Text[Style["Here are all my graphs", 24, Bold, Blue]],
  Grid[
   Partition[
    Table[
     ListPlot[RandomInteger[{0, 10}, 10], ImageSize -> 400,  
      PlotLabel -> "Figure number " <> ToString[i]], {i, 9}], 3]]},
 Alignment -> Center]
$\endgroup$
3
  • $\begingroup$ Thanks for the answer. But I would like to have the possibility, to place the plots on the sheet, to add a title, a legend, ... . I think Grid doesn't give me enough flexibility $\endgroup$
    – RMMA
    Commented Mar 23, 2015 at 23:04
  • $\begingroup$ A title for the full set, or a title on each subgraph? Both are trivial. $\endgroup$ Commented Mar 23, 2015 at 23:13
  • $\begingroup$ thanks, but now after adding the title the format of the pdf changes. That's why I chose to use Graphics with a fixed image size together with Inset. $\endgroup$
    – RMMA
    Commented Mar 24, 2015 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.