- 1、本文档共5页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
gnuplot的三维作图
假如数据文件data.txt中内容如下:# x ???y ???f(X,Y)0.1????0.1?????10.2????0.2?????3.50.3????0.3?????2.7...则f(X,Y)的图形可如下绘制:在gnuplot console中使用command:splot data.txt若要设定x和y的范围:splot [xi,xf] [yi,yf] data.txt若要画colorful contour map:set pm3d mapsplot [xi,xf] [yi,yf] data.txt设定 x axis 显示的significant digit 为小数点后第10位set format x %1.10f同理可设置 y axis设定 x axis tics 的间距为0.1:set xtics 0.1存为彩色eps图,图名为img.eps:set terminal postscript eps color enhancedset output img.epsreplot1. 输出格式
gnuplot set terminal x11 %输出到屏幕(Linux)
gnuplot set terminal postscript portrait noenhanced monochrome blacktext \
dashed dashlength 1.0 linewidth 1.0 defaultplex \
palfuncparam 2000,0.003 \
butt Helvetica 14
gnuplot set output test.ps %输出到PS文件, 以便插入到LaTeX文件中.
gnuplot set terminal png small color picsize 640 480
gnuplot set output test.png %输出到图像文件, 以便插入到html文件中.
2. 基本绘图命令
gnuplot plot test2d.dat with lines %绘制曲线图(二维图形)
gnuplot splot test3d.dat with lines %绘制曲面图(三维图形)
test2d.dat 中的数据为两列, 第一列对应横坐标, 第二列为纵坐标(函数值)
test3d.dat 中的数据为三列, 第一,二列对应坐标, 第三列为纵坐标(函数值),
例如:
x1 y1 z11
x1 y2 z12
x1 y3 z13
//空一行!
x2 y1 z11
x2 y2 z12
x2 y3 z13
//空一行!
x3 y1 z11
x3 y2 z12
x3 y3 z13
gnuplot unset surface %不绘制表面图
gnuplot set contour %绘制等值线图
gnuplot set cntrparam levels discrete .1,1/exp(1),.9 %定制等值线
gnuplot set cntrparam levels auto 5
gnuplot set view 0,0
3. 一些例子
set hidden3d; set ticslevel 0; set parametric
set isosamples 28,14
set urange [0:2*pi]; set vrange [-pi:pi]
set size 0.8,1; set view 60,20,1,1
set ticslevel 0
splot cos(u)+.5*cos(u)*cos(v),sin(u)+.5*sin(u)*cos(v),.5*sin(v), \
1+cos(u)+.5*cos(u)*cos(v), .5*sin(v), sin(u)+.5*sin(u)*cos(v)
set term table
set out tori.table
replot
!gnuconvf -s 200 -i tori.table -o tori.ppm -r 0.85 -X50 -Y-100 -Z50
!convert -transparency black tori.ppm tori.jpg
set samples 36
set isosample 36,36
set hidden3d
set ticslevel 0
splot sin(x)*sin(y)/x/y
set term table
s
您可能关注的文档
最近下载
- 2025年特种设备安全管理人员A证考试练习题.pdf VIP
- 基于EVA的恒瑞医药财务绩效评价研究.docx
- 课题研究成果鉴定申请书.doc
- 2025年护理学研究模拟试题(二) .pdf VIP
- 2023年宁波市奉化区教育系统招聘事业编制教师考试真题及答案.pdf
- 03G322-1 钢筋混凝土过梁.pdf VIP
- 2019《柴油电喷发动机电路图集大全》附电脑针脚端子图资料13页百.pdf
- 选择性必修一《当代国际政治与经济》第一——四课检测题.doc VIP
- 手把手教你成为音乐家—乐理应当这样学(山东大学)中国大学MOOC慕课章节测验答案(课程ID:1449542162).pdf
- 甄嬛传英文剧本.docx
文档评论(0)