gnuplot的三维图.doc

  1. 1、本文档共6页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
gnuplot的三维图

假如数据文件data.txt中内容如下: # x ???y ???f(X,Y) 0.1????0.1?????1 0.2????0.2?????3.5 0.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 map splot [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 enhanced set output img.eps replot 1. 输出格式 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)/

文档评论(0)

bguarfan + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档