I have following code:

    a + 0.017*k + (-0.014*k)*Tanh[(k - 0.25)*b], {k, 0.1, 10}],
      {b, {0.1, 0.2, 0.3, 0.4}}, {a, {1.0, 1.1, 1.2, 1.3}}]

I get then a table of plots and I can click on each of them to save them. But how do I save them all at once into a single PDF?

If I instead do:

       a + 0.017*k + (-0.014*k)*Tanh[(k - 0.25)*b], {k, 0.1, 10}],
         {b, {0.1, 0.2, 0.3, 0.4}}, {a, {1.0, 1.1, 1.2, 1.3}}]]

I cannot right click on the figure to save as some image, but rather have to export it. And I am really not satisfied by the result.

Export["grid1", %, "PDF"]

All axes and fonts are completely squeezed, big and unreadable.


How do I set borders and fonts and all that in an easy manner?

The best way would be really being able to right click on the table of plots and save it as it looks like.

  • $\begingroup$ You can Rasterize the grid and export that if you do not need vector graphics. $\endgroup$ – Yves Klett Feb 27 '13 at 16:00
  • 1
    $\begingroup$ If you provide an ImageSize option to GraphicsGrid, it outputs at a more controllable size. But Export is not much different from Save As... $\endgroup$ – cormullion Feb 27 '13 at 16:04
  • 2
    $\begingroup$ You can right-click on the cell bracket. A menu will appear with "Save Selection As" among the options. You can then save it as PDF. (v.9) $\endgroup$ – DavidC Feb 27 '13 at 16:05
  • $\begingroup$ @David you should make that an answer; it's the method I would use. $\endgroup$ – Mr.Wizard Feb 27 '13 at 16:19

Yes, it's a bit frustrating to click on the output and not see an option to save to disk. Fortunately, you can right-click on the cell bracket and Save Selection As a PDF file.

Set the image size by hand before saving, or use the ImageSize setting, as suggested by @cormullion.

  • $\begingroup$ Yes I also found that by putting the cursor just after the GraphicsGrid plot, and then selecting the plot with Shift+Back Arrow, I get the usual orange box. Then right clicking on the orange line, gives me the option Save Graphic As... $\endgroup$ – Santi Feb 27 '13 at 16:50
  • $\begingroup$ The key thing appears to be to highlight the output before right-clicking. $\endgroup$ – DavidC Feb 27 '13 at 18:46

Since you mentioned squished axes values when using GraphicsGrid, you can use a combination of ImageSize and BaseStyle--along numerous options to tweak plots and graphics, more info here--within LogLogPlot to achieve the look you want (I haven't experimented with it much but I found font size at 1/20 of image size looks decent). You can also specify the overall size of the final image by using another ImageSize within GraphicsGrid.

size = 100;
grid1 = GraphicsGrid[
    a + 0.017 k - (0.014 k) Tanh[(k - 0.25) b], {k, 0.1, 10},
    ImageSize -> size, BaseStyle -> {FontSize -> size/20.}],
   {b, {0.1, 0.2, 0.3, 0.4}}, {a, {1.0, 1.1, 1.2, 1.3}}]]
Export["grid1.pdf", grid1];

Mathematica graphics


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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