Gnuplot科学绘图
系列内容Gnuplot科学绘图(二十一)——简单 3D 函数绘图Gnuplot科学绘图(二十二)——数据文件存储格式Gnuplot科学绘图(二十三)—— 3D 数据曲面绘图及边框Gnuplot科学绘图(二十四)——pm3d 绘图
Gnuplot科学绘图(二十五)——色板(palette)设置
Gnuplot科学绘图(二十六)——image 绘图
gnuplot> set view map
gnuplot> set size square
gnuplot> replot
如果我们想在之前提到过的 pm3d 图上显示等高线,可以这样做:
gnuplot> set pm3d at b
gnuplot> set key at screen 0.8,0.8
gnuplot> replot
这里我们把图例的位置做了调整,因为默认图例是在图像里面的,这样可能影响我们的图像显示。
最后,我们谈谈怎样手动设置等高线数值和间距。等高线的数值间隔参数设置命令是 set cntrparam levels。默认情况下,gnuplot 自动设置等高线数值。如果要进行手动设置,有两种方法:
gnuplot> replot
本文整理自马欢老师科学网博客,特此感谢原作者的分享。
Materials Studio系列内容中科大 Materials Studio 培训快速入门教程(包你学会!)精选众多论坛讨论贴,Materials-Studio 论坛问答全集怎样把Materials studio能带图做得漂亮,用Matlab绘制呀!Materials Studio手把手教程丨界面操作、应用与NaCl晶体构建实例怎么利用Materials Studio建立晶体模型?就是这么简单!手把手教你用Materials Studio计算碳纳米管的能带结构基于Materials Studio的异质结构建模技巧如何分析第一原理计算结果:电荷密度图、能带结构、态密度的分析70张图,搞定能带理论基础!【长篇图文,包教包会】Materials Studio软件——CASTEP使用教程详解Gnuplot科学绘图(一)——从安装到简单函数绘图(文末有彩蛋)Gnuplot科学绘图(二)——坐标取值范围及刻度(文末有彩蛋)Gnuplot科学绘图(三)——点线风格Gnuplot科学绘图(四)——多组数据绘图Gnuplot科学绘图(五)——输出eps 图片Gnuplot科学绘图(六)——输出pdf 和png 图片Gnuplot科学绘图(七)——Enhanced 文本模式Gnuplot科学绘图(八)——插入LATEX 公式Gnuplot科学绘图(九)——栅格以及方程数值解估算Gnuplot科学绘图(十)——第二坐标轴Gnuplot科学绘图(十一)——Gnuplot 的坐标系统及标签Gnuplot科学绘图(十二)——箭头Gnuplot科学绘图(十三)——边框和坐标轴Gnuplot科学绘图(十四)——图例Gnuplot科学绘图(十五)——对数坐标Gnuplot科学绘图(十六)——图像尺寸
Gnuplot科学绘图(十七)——极坐标
Gnuplot科学绘图(十八)——参数方程
Gnuplot科学绘图(十九)——误差条(error bar)
Gnuplot科学绘图(二十)——拟合
Gnuplot科学绘图(二十一)——简单 3D 函数绘图
Gnuplot科学绘图(二十二)——数据文件存储格式
Gnuplot科学绘图(二十三)—— 3D 数据曲面绘图及边框
Gnuplot科学绘图(二十四)——pm3d 绘图
Gnuplot科学绘图(二十五)——色板(palette)设置
Gnuplot科学绘图(二十六)——image 绘图
等高线图是另一类重要的 3D 绘图方式。
首先绘制普通曲面图:
gnuplot> set hidden3d
gnuplot> splot "surface.dat" with lines
下面加上等高线:
gnuplot> set contour base
gnuplot> splot "surface.dat" with lines title ""
set contour 命令之后除了 base 参数外,还可以使用 surface 或 both 参数,分别表示等高线画在底面、曲面或者两者都画。这里设置了一个空的 title,是为了在图例中不要显示文件名,以免和等高线的图例混淆。
如果我们想在平面中显示等高线,可以使用下列命令:
gnuplot> unset surfacegnuplot> set view map
gnuplot> set size square
gnuplot> replot
![ebe5791b-b31a-eb11-8da9-e4434bdf6706.png](http://p01.5ceimg.com/content/ebe5791b-b31a-eb11-8da9-e4434bdf6706.png)
gnuplot> set key at screen 0.8,0.8
gnuplot> replot
![eee5791b-b31a-eb11-8da9-e4434bdf6706.png](http://p01.5ceimg.com/content/eee5791b-b31a-eb11-8da9-e4434bdf6706.png)
- incremental ,,
设置起始值以及间隔大小,这种方法适用于等间隔的等高线; - discrete ,,,…
分别设置各个等高线数值,这种方法适用于间隔不等的等高线。
gnuplot> replot
![efe5791b-b31a-eb11-8da9-e4434bdf6706.png](http://p01.5ceimg.com/content/efe5791b-b31a-eb11-8da9-e4434bdf6706.png)