next up previous contents
Next: SIZEFIG Set Size of Up: Figure Functions Previous: Figure Functions   Contents

Subsections

PRINT Print a Figure To A File

Usage

This function ``prints'' the currently active fig to a file. The generic syntax for its use is

  print(filename)

or, alternately,

  print filename

where filename is the (string) filename of the destined file. The current fig is then saved to the output file using a format that is determined by the extension of the filename. The exact output formats may vary on different platforms, but generally speaking, the following extensions should be supported cross-platform:

Note that only the fig is printed, not the window displaying the fig. If you want something like that (essentially a window-capture) use a seperate utility or your operating system's built in screen capture ability.

Example

Here is a simple example of how the figures in this manual are generated.

--> x = linspace(-1,1);
--> y = cos(5*pi*x);
--> plot(x,y,'r-');
--> print printfig1.eps
--> print printfig1.jpg

which creates two plots printfig1.eps, which is an Encapsulated Postscript file, and printfig1.jpg which is a JPEG file.

8397


next up previous contents
Next: SIZEFIG Set Size of Up: Figure Functions Previous: Figure Functions   Contents
Samit K. Basu 2005-03-16