This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / The Mathematica Book / Practical Introduction / Files and External Operations  /

1.11.5 Exporting Graphics

Mathematica provides a variety of mechanisms for exporting graphics that you generate to printers and other programs.
If you use the notebook front end for Mathematica, then you can typically just copy and paste graphics directly using the standard mechanism available on your computer system.

Ways to export Mathematica graphics.

The command Display allows you systematically to send graphics from Mathematica to external files and programs.

  • This generates a plot.
  • In[1]:= Plot[Sin[x] + Sin[Sqrt[2] x], {x, 0, 10}]

  • This saves the plot in a file in Encapsulated PostScript format.
  • In[2]:= Display["sinplot.eps", %, "EPS"]


  • Here is a typical command for printing the plot on a Unix system.
  • In[3]:= Display["!lpr", %, "EPS"]


    Typical graphics formats supported by Mathematica. The first group are resolution independent.

    When you export a graphic outside of Mathematica, you usually have to specify the absolute size at which the graphic should be rendered. You can do this using the ImageSize option to Display.
    ImageSize->x makes the width of the graphic be x printer's points; ImageSize->72xi thus makes the width xi inches. The default is to produce an image that is four inches wide.

    Options for Display.

    Within Mathematica graphics are manipulated in a way that is completely independent of the resolution of the computer screen or other output device on which the graphics will eventually be rendered.
    Many programs and devices accept graphics in resolution-independent formats such as Encapsulated PostScript (EPS). But some require that the graphics be converted to rasters or bitmaps with a specific resolution. The ImageResolution option for Display allows you to determine what resolution in dots per inch (dpi) should be used. The lower you set this resolution, the lower the quality of the image you will get, but also the less memory the image will take to store. For screen display, typical resolutions are 72 dpi and above; for printers 300 dpi and above.