| File Information |
| Description |
This function saves a figure or single axes to one or more vector and/or bitmap file formats, and/or outputs a rasterized version to the workspace, with the following properties:
- Figure/axes reproduced as it appears on screen
- Cropped borders
- Embedded fonts (vector formats)
- Improved line and grid line styles (vector formats)
- Anti-aliased graphics (bitmap formats)
- Transparent background supported (pdf, eps, png)
- Semi-transparent patch objects supported (png only)
- CMYK output optional (pdf, eps, tiff)
- Append to file (pdf only)
- Vector formats: pdf, eps
- Bitmap formats: png, tif, jpg, bmp, export to workspace
This function is especially suited to exporting figures for use in publications and presentations, because of the high quality and portability of media produced.
Note that the background color and figure dimensions are reproduced (the latter approximately, and ignoring cropping & magnification) in the output file. For transparent background (and semi-transparent patch objects), set the figure (and axes) 'Color' property to 'none'; pdf, eps and png are the only file formats to support a transparent background, whilst the png format alone supports transparency of patch objects.
When exporting to vector format (pdf & eps), this function requires that ghostscript is installed on your system. You can download this from:
http://www.ghostscript.com
When exporting to eps it additionally requires pdftops, from the Xpdf suite of functions. You can download this from:
http://www.foolabs.com/xpdf
When reporting bugs, please use the 'Contact Author' link on my Author page, rather than pasting the error into the comments - I will respond quicker, especially if I can email you back. |
| Acknowledgements |
The author wishes to acknowledge the following in the creation of this submission:
savefig, Fix dashed and dotted lines in EPS export, FIXPSLINESTYLE, Myaa - My Anti-Alias for Matlab, print_pdf, print2im, print_eps, fix_lines
This submission has inspired the following:
Matlab Icon for Linux (with Transparency)
|
| MATLAB release |
MATLAB 7.5 (R2007b)
|
| Other requirements |
Ghostscript, Xpdf |
| Zip File Content |
|
| Other Files |
eps2pdf.m, export_fig.m, fix_lines.m, license.txt, pdf2eps.m, print2array.m, print2eps.m, private/ghostscript.m, private/pdftops.m
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 15 Apr 2009 |
Added ability to export rasterized figure straight to the workspace. |
| 19 Apr 2009 |
Added ability to append to pdf files, as suggested by Matt C. Corrected some help text. |
| 21 Apr 2009 |
Incorporated Christian Dorion's patch for updating ghostscript (and also pdftops) path. Fixed bug that didn't correctly detect if pdftops path was valid (due to a MATLAB/Windows bug). |
| 24 Apr 2009 |
Added ability to compute transparency of patch objects when outputting to png and exporting to workspace. |
| 28 Jun 2009 |
Fixed bug to allow exporting of axes that are children of uipanels. Thanks to Stefan for pointing out the bug. |
| 21 Jul 2009 |
Export colorbars associated with subplots when in a uipanel. Thanks to Johannes Korsawe for pointing out the bug. |
| 29 Jul 2009 |
Added options to disable cropping and set level of anti-aliasing. Added a fix to get round a rendering bug in print (thanks to Johannes Korsawe for pointing it out). |
| 31 Jul 2009 |
Added option to use zbuffer renderer for bitmaps. This avoids some errors caused by bugs in the opengl renderer.
Fixed bug when exporting greyscale figures with an alphamatte (thanks to Annette for pointing it out). |
| 09 Oct 2009 |
Added ability to export at any resolution (bitmap outputs only) and also in CMYK colorspace (tiff, pdf, eps only). |
|