Saving MATLAB Graphics in File Format
In addition to options for printing directly to hardcopy devices, MATLAB provides the ability to produce files in various graphics formats for importing into other applications.
Creating Graphics Files
There are several ways to create graphics files in MATLAB.
Using the print Command
When you use the print command and specify a filename, MATLAB creates the file but does not send it to the printer. Select a device option that creates a format that you can import into the target application.
You can use MATLAB's built-in drivers to produce graphics files in Encapsulated PostScript, Adobe Illustrator 88, and HPGL formats. To produce a file in one of these formats, specify the appropriate device option, and provide a name for the file. For example, this command produces an HPGL file named surfplot.hgl:
print -dhpgl surfplot
Additional formats are available only on certain platforms. On PC and UNIX systems, you can o produce standard graphics file formats such as PostScript, TIFF, JPEG, and PNG . On the PC, you can create files in Windows Bitmap and Windows Enhanced Metafile format by using the -dbitmap option or the -dmeta option and specifying a filename. (If you omit the filename, the Metafile or Bitmap is placed in the clipboard.)
For example, this command creates a Windows Bitmap file named surfplot.bmp:
print -dbitmap surfplot
This command creates a Metafile of figure 2 and places in the clipboard:
print -f2 -dmeta
[ Previous | Help Desk | Next ]