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 |
Matlab绘图基础——用print函数保存图片(Print figure or save to file)的更多相关文章
- Matlab绘图基础——图形修饰处理(入门)
引入--标题.色条.坐标轴.图例等 例一: set(groot,'defaultAxesLineStyleOrder','remove','defaultAxesColorOrder','remove ...
- Matlab绘图基础——用print函数批量保存图片到文件(Print figure or save to file)
一.用法解析 1.1. 分辨率-rnumber 1.2. 输出图片的“格式”formats 二.用法示例 2.1. 设置输出图片的“图像纵横比” 2.2. Batch Processing(图片保存 ...
- 2.1 Python3基础-内置函数(print&input)
>>返回主目录 源代码 # 内置函数:输入/输出 name = 'Portos' age = 18 sex = 'man' score = 99.5 print('Hello World! ...
- Matlab绘图基础——绘制三维表面
%绘制三维表面 ------------------------------------- %1.绘制线框图:mesh:每一条曲线称为mesh line %首先利用meshgrid函数产生平面区域内的 ...
- Matlab绘图基础——散点生成三角网(TIN)
%例一:二维三角网TIN模型的生成 X=rand(10,2)*5; dt=DelaunayTri(X(:,1),X(:,2)); %生成三角网 triplot(dt);hold on; ...
- Matlab绘图基础——绘制等高线图
% 等高线矩阵的获取 C = contourc(peaks(20),3); % 获取3个等级的等高线矩阵 % 等高线图形的绘制 contour(peaks(20),10);c ...
- Matlab绘图基础——一些标准三维曲面
标准三维曲面 t=0:pi/20:2*pi; [x,y,z]= cylinder(2+sin(t),30); %[x,y,z]= cylinder(R,n),其中R为圆周半径,n为组成圆周的点 ...
- Matlab绘图基础——其他三维图形(绘制填充的五角星)
其他三维图形 %绘制魔方阵的三维条形图 subplot(2,2,1); bar3(magic(4)); %以三维杆图形式绘制曲线y=2sin(x) subplot(2,2,2); y=2*sin( ...
- Matlab绘图基础——利用axes(坐标系图形对象)绘制重叠图像 及 一图多轴(一幅图绘制多个坐标轴)
描述 axes在当前窗口中创建一个包含默认属性坐标系 axes('PropertyName',propertyvalue,...)创建坐标系时,同时指定它的一些属性,没有指定的使用DefaultAxe ...
随机推荐
- dojo省份地市级联之省份封装类(一)
省份封装类 Province.java /** * 省份封装类 */ package com.you.model; import java.io.Serializable; /** * @author ...
- Java获取某年某季度的第一天出错
1.错误描述 Exception in thread "main" java.lang.IllegalArgumentException: Cannot format given ...
- dpkg: error: -i (--install) 和 -i (--install) 两个操作之间有矛盾
1 错误描述 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ sudo dpkg -i -i WineQQ2013-20131120-Longene.deb [ ...
- javaWeb学习之Listener监听
] 一.监听器Listener javaEE包括13门规范 在课程中主要学习 servlet技术 和 jsp技术 其中 servlet规范包括三个技术点:servlet listener filt ...
- 芝麻HTTP:JavaScript加密逻辑分析与Python模拟执行实现数据爬取
本节来说明一下 JavaScript 加密逻辑分析并利用 Python 模拟执行 JavaScript 实现数据爬取的过程.在这里以中国空气质量在线监测分析平台为例来进行分析,主要分析其加密逻辑及破解 ...
- Apache Hive 基本理论与安装指南
一.Hive的基本理论 Hive是在HDFS之上的架构,Hive中含有其自身的组件,解释器.编译器.执行器.优化器.解释器用于对脚本进行解释,编译器是对高级语言代码进行编译,执行器是对java代码的执 ...
- jxl导入/导出excel(网上的案例)
jxl导入/导出excel 1.jxl导入/导出excel案例,黏贴即可运行 package junit.test; import java.io.File; import java.io.IOExc ...
- monkeyrunner_获取apk的包名和activity名
一.使用adb获取单个apk的包名和Activity名称: 1.配置adb环境 a. 我的电脑点击右键-属性-高级-环境变量; b. 环境变量中新建PATH,变量值输入adb.exe工具所在目录; ...
- C#中string类型是值类型还是引用类型?
.Net框架程序设计(修订版)中有这样一段描述:String类型直接继承自Object,这使得它成为一个引用类型,也就是说线程上的堆栈上不会驻留有任何字符串. string类型(引用类型) 名称 CT ...
- Python Cookbook(第3版)中文版:15.15 C字符串转换为Python字符串
15.15 C字符串转换为Python字符串¶ 问题¶ 怎样将C中的字符串转换为Python字节或一个字符串对象? 解决方案¶ C字符串使用一对 char * 和 int 来表示, 你需要决定字符串到 ...