另一个关于等高线图的问题。我正在使用
G N U P L O T
Version 4.6 patchlevel 6 last modified September 2014
Build System: Linux x86_64
我正在尝试绘制彩色 map 并在其上绘制等高线图。我的终端是
set terminal pngcairo enhanced size 1440,900 crop font "Palatino,27"
我想画这个
set contour surface
set cntrparam level discrete 0.3,0.067
set style line 2 lt 1 lc rgb "black" lw 3
set style line 3 lt 3 lc rgb "black" lw 1
set style increment user
splot 'file1' binary w pm3d nocontour,\
'file2' binary w l nosurface
所以设置等高线来绘制两条等值线,两条等值线都是黑色的,一条是虚线,一条是实线,一条是粗线,一条是细线。它绘制了两条粗细相同的红色实线。
我尝试了在 Google 上随处可见的许多解决方案。
1) 我将“set style line ...”替换为“set linetype ...”并删除“set style increment user”行。线条变成黑色、实心、粗细相等。我可以改变颜色。
2) 我试图添加“set termoption dashed”行。什么都没有,破灭从未见过。
我哪里错了?
非常感谢。
最佳答案
确实,目前您不能为不同的轮廓使用任意的线型或样式。更改颜色可以工作,还可以设置一种破折号类型(然后使用第一种轮廓样式),但不能混合虚线和实线并更改线宽。
在那种情况下,您必须将轮廓写入文件,就像您在第一个问题中所做的那样:)
稍后可以使用 index
关键字访问不同的轮廓级别。但请注意,在第一个数据集中,您将拥有完整的表面,等高线从 index 1
开始:
set termoption dashed
set contour surface
set cntrparam level discrete 0.3,0.067
set style line 2 lt 1 lc rgb "black" lw 3
set style line 3 lt 3 lc rgb "black" lw 1
set table 'temp.dat'
splot 'file2' binary
unset table
unset contour
splot 'file1' binary w pm3d nocontour,\
for [i=1:2] 'temp.dat' index i with lines ls (i+1)
关于styles - GNUPLOT 4.6 : custom contour lines,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30530779/