大工至善|大学至真分享 http://blog.sciencenet.cn/u/lcj2212916

博文

[转载]分享一种可导出各类型图片文件的小工具export_fig

已有 501 次阅读 2018-7-31 09:31 |系统分类:科研笔记|文章来源:转载

 分享一种可导出各类型图片文件的小工具export_fig,适合各种场合的科研学术需要。


下载地址:http://tadown.com/fs/5lcaj2b21929416ffa4/



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 (pdf only) 
- 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 
- Bitmap formats: png, tiff, 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), 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://www.ghostscript.com 

When exporting to eps it additionally requires pdftops, part of the Xpdf package. You can download this from: 
http://www.xpdfreader.com 

This submission was originally created by Oliver Woodford. Yair Altman maintains this utility since Jan 2015. 



http://blog.sciencenet.cn/blog-69686-1126797.html

上一篇:[转载][劇情] [书店 The Bookshop (2017)][主演: 艾米莉·莫迪默][英国]
下一篇:[转载][動作] [碟中谍6:全面瓦解 Mission: Impossible (2018)

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备14006957 )

GMT+8, 2018-10-24 10:41

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部