File Exchange

image thumbnail


version (1.89 KB) by John Ramshur
Saves the current figure with user specified resolution as an image file or pdf file.


Updated 08 Jan 2013

View Version History

View License

Easy to use function. Let's you save the CURRENT FIGURE as an image file or pdf file. A pop-up dialog prompts user where to save the image and what image compression to use. Default dpi is 300 (print quality). User can specify any dpi. The user can also specify whether to use the default image size or the current figure size on the screen.

Cite As

John Ramshur (2021). fig2img (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)

John Ramshur

Sorry for any confusion. Simply click on you figure then run the fig2img function from the command line. Below are some example usages.

Example 1: Use "fig2img" to save figure to image file using 300dpi.

Example 2: Use "fig2img(600,1)" to save figure at 600 dpi using the current figure size/dimensions.




I could not understand how to use this code which would be really helpful for me :)

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

Inspired by: Exportfig

Inspired: fig2img

Community Treasure Hunt

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

Start Hunting!