Exporting Graphics from Mathematica

[images/sinemovie.gif]

Basic examples


First, you need to tell Mathematica where to save the files, by executing something like this:

[images/mmaexbe1.gif]
Then make your plot, and assign it a name:
[images/mmaexbe2.gif]
The following Mathematica command will then save your plot as a GIF file:
[images/mmaexbe3.gif]
which looks like this in a web page:
[images/sine.gif]
It's just as easy to get a JPG:
[images/mmaexbe4.gif]
which looks like this:
[images/sine.jpg]
You can directly adapt the same Input cell  to get encapsulated postscript (which has resolution limited only by the display device):
[images/mmaexbe5.gif]
Many other graphics formats are available in the same way.
 

Animations

The following Mathematica input makes the frames of a simple animation:
[images/mmaexbe6.gif]
The animation can be exported as an animated GIF, thus:
[images/mmaexbe7.gif]
The animated GIF, sinemovie.gif, is displayed at the top of this web page, but it runs only once, and it's easy to miss!

If you want the animation to run repeatedly, include a "ConversionOption" like this:

[images/mmaexbe8.gif]
Here's the resulting animated GIF:
[images/sineloop.gif]

More examples, and further comments

A dressed-up 2D plot  [Click here for the Mathematica code that produced this picture.]


First a JPG:

[images/fancysine.jpg]
which apparently has some anti-aliasing and color distortion that the GIF (below) doesn't have.
[images/fancysine.gif]

A 3D plot (spherical harmonic)  [Click here for the Mathematica code that produced this picture.]

[images/shy31.gif]

A 3D animation (conic sections) [Click here for the Mathematica code that produced this picture.]

[images/conemovie.gif]
Note:  This animated GIF has 21 frames, and a file size of 94KB.


Preston Nichols' Main Mathematica Page
Preston Nichols' Front Door
Wittenberg University Department of Mathematics and Computer Science