Matlab绘图基础——用print函数保存图片(Print figure or save to file)
分辨率-rnumber
Use -rnumber to specify the resolution of the generated output.
To set the resolution(分辨率) of the output file for a built-in MATLAB format, use the -r switch. (For example, -r300 sets the output resolution to 300 dots per inch(每英寸300个点).)
The -r switch is also supported for Windows Enhanced Metafiles(增强型图元文件), JPEG, TIFF and PNG files, but is not supported for Ghostscript raster formats(栅格文件). For more information, see Printing and Exporting without a Display and Resolution Considerations.
——————来自matlab帮助“print”页中
设置输出图片的“图像纵横比”
When you set the axes Position to [0 0 1 1] so that it fills the entire figure, the aspect ratio is not preserved when you print because MATLAB printing software adjusts the figure size when printing according to the figure's PaperPosition property. To preserve the image aspect ratio(图像纵横比) when printing, set the figure's 'PaperPositionMode' to 'auto' from the command line.
——来自matlab帮助 Printing Images
Batch Processing(图片保存“批处理”)filename
You can use the function form of print to pass variables containing file names. For example, this for loop uses file names stored in a cell array to create a series of graphs and prints each one with a different file name:
————来自matlab帮助“print”页末
注:如果你不能调整输出分辨率和文件格式,可能是"Printing and Exporting without a Display"问题,具体查看帮助“print”页
输出图片的“格式”formats
The following table shows the supported output formats for exporting from figures and the switch settings to use. In some cases, a format is available both as a MATLAB output filter and as a Ghostscript output filter. All formats except for EMF are supported on both Windows and UNIX platforms.
Graphics Format |
Bitmap or Vector(矢量) |
Print Command Option String |
MATLAB or Ghostscript |
---|---|---|---|
BMP monochrome BMP |
Bitmap |
-dbmpmono |
Ghostscript |
BMP 24-bit BMP |
Bitmap |
-dbmp16m |
Ghostscript |
BMP 8-bit (256-color) BMP (this format uses a fixed colormap) |
Bitmap |
-dbmp256 |
Ghostscript |
BMP 24-bit |
Bitmap |
-dbmp |
MATLAB |
EMF |
Vector |
-dmeta |
MATLAB |
EPS black and white |
Vector |
-deps |
MATLAB |
EPS color |
Vector |
-depsc |
MATLAB |
EPS Level 2 black and white |
Vector |
-deps2 |
MATLAB |
EPS Level 2 color |
Vector |
-depsc2 |
MATLAB |
HDF 24-bit |
Bitmap |
-dhdf |
MATLAB |
ILL (Adobe Illustrator) |
Vector |
-dill |
MATLAB |
JPEG 24-bit |
Bitmap |
-djpeg |
MATLAB |
PBM (plain format) 1-bit |
Bitmap |
-dpbm |
Ghostscript |
PBM (raw format) 1-bit |
Bitmap |
-dpbmraw |
Ghostscript |
PCX 1-bit |
Bitmap |
-dpcxmono |
Ghostscript |
PCX 24-bit color PCX file format, three 8-bit planes |
Bitmap |
-dpcx24b |
Ghostscript |
PCX 8-bit newer color PCX file format (256-color) |
Bitmap |
-dpcx256 |
Ghostscript |
PCX Older color PCX file format (EGA/VGA, 16-color) |
Bitmap |
-dpcx16 |
Ghostscript |
PDF Color PDF file format |
Vector |
-dpdf |
Ghostscript |
PGM Portable Graymap (plain format) |
Bitmap |
-dpgm |
Ghostscript |
PGM Portable Graymap (raw format) |
Bitmap |
-dpgmraw |
Ghostscript |
PNG 24-bit |
Bitmap |
-dpng |
MATLAB |
PPM Portable Pixmap (plain format) |
Bitmap |
-dppm |
Ghostscript |
PPM Portable Pixmap (raw format) |
Bitmap |
-dppmraw |
Ghostscript |
SVG Scalable Vector Graphics (For Simulink Models Only) |
Vector |
-dsvg |
MATLAB |
TIFF 24-bit |
Bitmap |
-dtiff or -dtiffn |
MATLAB |
TIFF preview for EPS files |
Bitmap |
-tiff |
最新文章
- ubuntu 14.04 ns2.35 ***buffer overflow detected **: ns terminated解决办法
- Android Sudoku第一版
- JAVA的网络编程基础概念
- 去除DataTable重复数据的三种方法
- 008. asp.net mvc3.0安装文件及其安装时发生错误的解决方案
- DBMS_ERRLOG记录DML错误日志(一)
- scala学习笔记:理解并行集合par
- Python第三方库(模块)";scikit learn";以及其他库的安装
- php实现分页
- [html5] 学习笔记-Canvas应用
- Selenium滚动条window.scrollTo和window.scrollBy
- python中int的功能简单介绍
- Python爬虫入门教程 35-100 知乎网全站用户爬虫 scrapy
- 菜鸟教程之学习Shell script笔记(下)
- HDU4704(SummerTrainingDay04-A 欧拉降幂公式)
- 【Leetcode】378. Kth Smallest Element in a Sorted Matrix
- 七种RAID技术
- Class.forName(String name)方法,到底会触发那个类加载器进行类加载行为?
- Service简介 demos
- (27)Cocos2d-x 3.0 Json用法
热门文章
- HI3531例子程序说明
- dedecms 在首页调取文章内容
- Educational Codeforces Round 36 (Rated for Div. 2) E. Physical Education Lessons
- WPF自学入门(二)WPF-XAML布局控件
- @SuppressWarnings(";unchecked";)(解决标准的后台HttpServletRequest request, HttpServletResponse response)格式
- 对于多线程下Servlet以及Session的一些理解
- Web 小案例 -- 网上书城(三)
- 【BZOJ2186】沙拉公主的困惑(数论)
- jquery切换
- CyQ.data MDataTable