GNUPLOT 4.6:自定义轮廓线

时间:2015-05-29 13:23:30

标签: styles line gnuplot contour

关于等高线图的另一个问题。我正在使用

    G N U P L O T
    Version 4.6 patchlevel 6    last modified September 2014
    Build System: Linux x86_64

我试图绘制彩色地图,并在其上绘制等高线图。我的终端是

    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)我替换"设置样式线......"使用"设置线型..."并删除"设置样式增量用户"线。线条变成黑色,实心,厚度相等。我可以改变颜色。

2)我试图添加"设置termoption虚线"线。什么都没有,从未见过。

我哪里错了?

非常感谢。

1 个答案:

答案 0 :(得分:1)

实际上,目前您不能对不同的轮廓使用任意线型或样式。更改颜色,同时设置一个短划线类型(然后使用第一个轮廓样式之一),但不混合虚线和实线并更改线宽。

在这种情况下,您必须将轮廓写入文件,就像您在第一个问题中所做的那样:)

稍后可以使用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)