image thumbnail

export_fig

version 3.18 (94.4 KB) by Yair Altman
Publication-quality export of Matlab figures and axes to various vector & bitmap formats

311.2K Downloads

Updated 03 Oct 2021

From GitHub

View license on GitHub

Editor's Note: Popular File 2011 2012 2013 2014 2015 2016 2017 2018

This file was selected as MATLAB Central Pick of the Week

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/padded borders (optional)
  • Embedded fonts (vector formats)
  • Improved line and grid line styles
  • Anti-aliased graphics (bitmap formats)
  • Render images at native resolution (optional for bitmap formats)
  • Transparent background supported (pdf, eps, png, tiff)
  • Semi-transparent patch objects supported (png, tiff)
  • RGB, CMYK or grayscale output (CMYK only with pdf, eps, tiff)
  • Variable image compression, including lossless (pdf, eps, jpg)
  • Optional rounded line-caps (pdf, eps)
  • Optionally append to file (pdf, tiff)
  • Vector formats: pdf, eps, emf, svg
  • Bitmap formats: png, tiff, jpg, bmp, clipboard, 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), use the -transparent option, and set the axes 'Color' property to 'none' where desired. Pdf, eps and png are the only file formats to support a transparent background, while the png format alone supports transparency of patch objects.
When exporting to vector format (pdf & eps), and to bitmap using the painters renderer, this function requires that ghostscript is installed on your system. You can download this from http://ghostscript.com
When exporting to eps it additionally requires pdftops, part of the Xpdf package. You can download this from http://xpdfreader.com
Usage examples and tips can be found in the README section at https://github.com/altmany/export_fig/blob/master/README.md
A technical description of the various components can be found at https://undocumentedmatlab.com/articles/export_fig
This submission was originally created by Oliver Woodford. Yair Altman maintains this utility since Jan 2015.
A single textual ad message is displayed once a week. I have no intention of removing the ad; if you don't want to see even a single ad once a week, don't use the program.
When reporting bugs, please raise an issue via GitHub: https://github.com/altmany/export_fig/issues and not here. Do not paste the error into the comments below - I will not respond to these.

Cite As

Yair Altman (2021). export_fig (https://github.com/altmany/export_fig/releases/tag/v3.18), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: MakeMovie, DT QP Project, surface2tikz(fighandle,filename,varargin), Spectral stochastic finite element method: 1D Euler-Bernoulli beam example, expandaxes, WIT Input/Output, Crack Monitor, LaTeX Output Classes for MatLab, fig2img, copyUIAxes, ExportPngInkscape(filename,dpi,handle), Mosaicator, Antarctic flight planning tools, WITio, Online portfolio selection with transaction costs including market impact costs, imageslices, PM Architectures Project, Semismooth* Newton method for contact friction problems, Simulation of von Kármán viscoelastic plates, Tight subplot with units in centimeter, efigure, matlab-save-figure, polarG(start_complex,end_complex,arrow_length,arrow_angle,colour_code,line_width), Microscopy Image Browser (MIB), Microscopy Image Browser 2 (MIB2), alexludwigklein/MATLAB-Videos, Plot multiple surfaces multisurf(x,y,z,color), Matlab Icon for Linux (with Transparency), MAGIC - MATLAB Generic Imaging Component, append_pdfs, Google Earth Overlay, Multiple Colormaps, EPS Utility Toolbox, Export figure to 3D interactive PDF, Co-Blade: Software for Analysis and Design of Composite Blades, Color Checker Chart, Save figure to file, choose the dimensions and crop figure, jrichter24/toPPT, Simulation of Random Walk, Multiple Page PDF, JCDstatusPlot, XivelyRead, imsavecircles, PlotPub - Publication Quality Graphs in MATLAB, Laser, Filters and CMOS-Imager Calibration, Philips Hue Lamp Controller, HCPARULA: High Contrast Parula-like Colormap Generator, bibget, Export Figure Widget (efw), export_tex, Causal State Modeller Toolbox, Machine learning - balancing a stack of balls, Fast and efficient spectral clustering, latexfigure, FIGUREMAKER - Publication quality figures with matlab, TeloTool - Terminal Restriction Fragment Analysis

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.