包括gnuplot中的实线和虚线轮廓

包括gnuplot中的实线和虚线轮廓,gnuplot,Gnuplot,我在gnuplot脚本中有以下内容: set pm3d unset surface set pm3d map set style line 1 lt 1 lc rgb "white" set style line 2 lt 1 lc rgb "white" set style line 3 lt 1 lc rgb "white" set style line 4 lt 1 lc rgb "red" set style line 5 lt 1 lc rgb "blue" set style l

我在gnuplot脚本中有以下内容:

set pm3d
unset surface
set pm3d map
set style line 1 lt 1 lc rgb "white"
set style line 2 lt 1 lc rgb "white"
set style line 3 lt 1 lc rgb "white"
set style line 4 lt 1  lc rgb "red"
set style line 5 lt 1  lc rgb "blue"
set style line 6 lt 2  lc rgb "white"
set style line 7 lt 2  lc rgb "white"
set style line 8 lt 2  lc rgb "white"
set style line 9 lt 2  lc rgb "white"
set style increment userstyles
set contour base
set cntrparam levels 8
set cntrparam levels discrete -8*0.0004946, -6*0.0004946, -4*0.0004946,     -2*0.0004946,    -2*0.0004946, 4*0.0004946, 6*0.0004946, 8*0.0004946
set nokey
splot '/data/ltl21/Data/PDB/HDFNI/BlindSurvey/imageresults/spectrum/HDF1map:189.20135-62.20442' u 1:2:3
因此,我希望虚线轮廓表示负值,实线轮廓表示正值。我可以用上面的细节来改变轮廓的颜色,虽然我希望它们都是白色的,但它似乎根本没有使用lt,它只是选择了自己的线条样式并使用了它

有人知道如何为各个等高线指定线型吗


干杯

同样的问题刚刚出现在我面前。我在以下网站找到了一个不错的解决方法:

将splot与标准选项一起使用。可以在一个文件中保存多个轮廓。同一文件中的每个等高线将以相同的样式打印。 您可以像往常一样设置打印选项:线型、线型等。我就是这样使用的:

gnuplot> set cntrparam levels discrete 0,1,2,3 
gnuplot> set style line 1 lt 2 lw 4 lc rgb "cyan"
gnuplot> set table 'mycontours.dat'
gnuplot> splot 'mydata.dat' matrix 
gnuplot> unset table
gnuplot> plot 'mycontours.dat' ls 1

它返回了EPS中的4个蓝色虚线轮廓。您似乎需要将不同轮廓样式保存到不同的文件中,或手动编辑该文件。

multiplot可用于解决此问题:

set pm3d
unset surface
set pm3d map
set view map
set key center rmargin
set dgrid3d 15,31
set hidden3d
set contour base
set nosurface
set grid lw 1 lc rgb 'gray'

f(x,y) = x*y

set nokey

set cntrparam levels discrete 2, 4, 6, 8

set linetype 1  lc rgb '#0042ad' lw 1.3
set linetype 2  lc rgb '#0060ad' lw 3.1
set linetype 3  lc rgb '#007cad' lw 31
set linetype 4  lc rgb '#0099ad' lw 0.31

set cntrlabel start 25 interval -1 font 'arial, 1'
set style textbox noborder

set multiplot

splot  f(x,y) w l title ''

unset pm3d
set linetype 1  lc rgb '#00ada4' lw 2 dashtype 2
# notice how changing 'lw' or 'dashtype' does not have any effect after first use:
set linetype 2  lc rgb '#00ad88' lw 1 dashtype 1
set linetype 3  lc rgb '#00ad6b' lw 3 dashtype 4
set linetype 4  lc rgb '#eeeeee' lw 4 dashtype 3
set cntrparam levels discrete -8, -6, -4, -2
splot  f(x,y) w l

unset multiplot
取消设置pm3d是至关重要的,否则它将从第一个splot命令绘制线

set pm3d
unset surface
set pm3d map
set view map
set key center rmargin
set dgrid3d 15,31
set hidden3d
set contour base
set nosurface
set grid lw 1 lc rgb 'gray'

f(x,y) = x*y

set nokey

set cntrparam levels discrete 2, 4, 6, 8

set linetype 1  lc rgb '#0042ad' lw 1.3
set linetype 2  lc rgb '#0060ad' lw 3.1
set linetype 3  lc rgb '#007cad' lw 31
set linetype 4  lc rgb '#0099ad' lw 0.31

set cntrlabel start 25 interval -1 font 'arial, 1'
set style textbox noborder

set multiplot

splot  f(x,y) w l title ''

unset pm3d
set linetype 1  lc rgb '#00ada4' lw 2 dashtype 2
# notice how changing 'lw' or 'dashtype' does not have any effect after first use:
set linetype 2  lc rgb '#00ad88' lw 1 dashtype 1
set linetype 3  lc rgb '#00ad6b' lw 3 dashtype 4
set linetype 4  lc rgb '#eeeeee' lw 4 dashtype 3
set cntrparam levels discrete -8, -6, -4, -2
splot  f(x,y) w l

unset multiplot