Graphics Previous page   Next Page

Description of Selected Graphics Formats

This section contains details about some of the export file formats MATLAB supports. For information about formats not listed here, consult a graphics file format reference.

Formats covered in this section are

Adobe Illustrator 88 Files

Adobe Illustrator (ILL) is a vector format that is fully compatible with Adobe Illustrator software. An Illustrator file created in MATLAB can be further processed with Adobe Illustrator running on any platform. (Note that when you view it in Illustrator, it will have no template.)

By default, Illustrator files are color and saved in portrait orientation. The Illustrator group command is used to give the illustrations a hierarchy similar to that of the Handle Graphics or Simulink graphic.

Some limitations of the Illustrator format are

EMF Files

Enhanced Metafiles (EMF) are vector files similar in nature to Encapsulated PostScript (EPS), capable of producing near publication-quality graphics. EMF is an excellent format to use if you plan to import your image into a Microsoft application and want the flexibility to edit and resize your image once it has been imported. It is the only MATLAB supported vector format you can edit from within a Microsoft application. (Note that your editing ability is limited. For the best results, do all your editing in MATLAB.)

A drawback of using EMF files is that they are generally only supported by Windows-based applications.

EPS Files

The Encapsulated PostScript (EPS) vector format is the most reliable and consistent file format MATLAB supports. It is widely recognized in desktop publishing and word processing packages on both UNIX and Windows platforms. EPS is the only MATLAB supported export format that can produce CMYK output. (PostScript printer drivers also support this feature.)

This format is your best choice for producing publication-quality graphics. It might not be appropriate for figures containing interpolated shading because it creates a very large file that is difficult to print. For such figures, use the TIFF format with a high-resolution setting. For more information about format choices, see Bitmap or Vector Graphics.

When imported into Microsoft applications, an EPS file will not display unless you add a TIFF preview image to it.

The preview image is simple to add (see the next section, "Creating a Preview Image"). However, if you print your file to a non-PostScript printer, the TIFF preview is used as the printed image. The resolution of the preview image is 72 dpi, resulting in much lower quality than the EPS image. If there is no preview image, your printout to a non-PostScript printer contains an error message in place of the graphic. Many high-end graphics packages, like Adobe Illustrator, can print an EPS file to a non-PostScript printer.

You cannot edit figures when using EPS files in Microsoft applications; they can only be annotated.

EPS format has limited font support. When MATLAB exports a graphic to the EPS file format, it does not try to determine whether the fonts you have used in your axes text objects are supported by the EPS format. Unsupported fonts are replaced with Courier.

Creating a Preview Image.   You cannot create TIFF preview images using the graphical user interface. Use the print command with the -tiff switch. For example, to create an EPS Level 2 image with TIFF preview in file myfile.eps, type

TIFF Files

The Tagged Image File Format (TIFF) is a very widely used bitmap format and can produce publication-quality graphics if you use a high-resolution setting (such as 200 or 300 dpi).

TIFF is a good format to choose if you are not sure what formats your target application supports, or if you want to import the graphic into more than one application without having to export it to several different formats. It can also be imported into most image-processing applications and converted to other formats, if necessary. For example, MATLAB does not produce GIF files (because of patent restrictions), but there are many applications that can convert TIFF files to GIF.

JPEG Files

The Joint Photographic Experts Group (JPEG) bitmap format is one of the dominant formats used in Web graphics. The 24-bit version MATLAB supports more colors than the popular GIF format.

JPEG files always use JPEG compression. This is a lossy compression scheme, meaning that some data is thrown away during compression. When you export to a JPEG image, you can set the amount of compression to use. The more compression you use, the more data is thrown away. The compression amount is referred to as JPEG quality, where the highest setting results in the highest quality image, but the lowest amount of compression.

Setting JPEG Quality.   You cannot set the quality using the graphical user interface. Use the print command with the -djpeg format switch, including the desired quality value as a suffix. This example exports to a JPEG file using a quality setting of 100.

By default, MATLAB uses a quality setting of 75. Possible values are from 1 to 100. Note that the highest setting of 100 still results in some data loss, although the result is usually visually indistinguishable from the original.


Previous page  Impact of Rendering Method on the Output How to Specify a Format for Exporting Next page

© 1994-2005 The MathWorks, Inc.