我尝试在gnuplot中使用multiplot选项绘制几个图。我使用如下所示的脚本。
#!/usr/bin/env gnuplot
#OUTPUT
#PNG
set terminal pngcairo size 600,550 enhanced dash #font "Arial-Bold,13" #fontscale 1.20
set output "Fill-Multi-plot-LDP-lyoSystemLast50ns.png"
#############################################################################
set style line 4 lt 1 lw 2.5 lc rgb "red"
set style line 5 lt 3 lw 2.5 lc rgb "forest-green"
set style line 6 lt 5 lw 2.5 lc rgb "blue"
#############################################################################
set macro
labelFONT="font 'Arial,18'"
scaleFONT="font 'Arial-Bold,14'"
scaleFONtt="font 'Helvetica,10'"
keyFONT="font 'Arial,10'"
#############################################################################
xsize = 0.80 # change this for expand in x direction
ysize = 0.22
xorigin = 0.022
yorigin = 0.02
#############################################################################
set xrange [-25.2:25.2] noreverse nowriteback
set yrange [0:2.5] noreverse nowriteback
set xtic auto @scaleFONT # set xtics automatically
set ytic '' #0,0.2,0.4 @scaleFONT # set ytics automatically
unset key
set size 1.0,1.0
set multiplot
#############################################################################
# plot A
set ylabel ""
set label "Distance in Angstrom" at -30.0,-0.22 @labelFONT
set label "Number Density" at -58,0.70 rotate by 90 left @labelFONT
set label "(e)" at 0,0.60 @scaleFONT
set origin xorigin,yorigin
set size xsize,(ysize+0.015)
plot "bcm25perRS-251-300ns_head_tail_wat2.dat" u 1:2 w filledcurves y1=0 fs transparent solid 0.35 ls 4, \
'' u 1:3 w filledcurves fs transparent solid 0.4 ls 5,\
'' u 1:4 w filledcurves fs transparent solid 0.5 ls 6
#################################################################################
# plot B
set xrange [-25.2:25.2]
set ylabel ""
unset label
set label "(d)" at 0,0.60 @scaleFONT
set origin xorigin,(yorigin+0.19)
set size xsize,ysize+0.02
plot "bcm25perS-251-300ns_head_tail_wat2.dat" u 1:2 w filledcurves y1=0 fs transparent solid 0.35 ls 4, \
'' u 1:3 w filledcurves fs transparent solid 0.4 ls 5,\
'' u 1:4 w filledcurves fs transparent solid 0.5 ls 6
#################################################################################
## plot C
set xrange [-25.2:25.2]
set ylabel ""
unset label
set label "(c)" at 0,0.60 @scaleFONT
set origin xorigin,(yorigin+0.385)
set size xsize,ysize+0.02
plot "bcm25perR-251-300ns_head_tail_wat2.dat" u 1:2 w filledcurves y1=0 fs transparent solid 0.35 ls 4, \
'' u 1:3 w filledcurves fs transparent solid 0.4 ls 5,\
'' u 1:4 w filledcurves fs transparent solid 0.5 ls 6
#################################################################################
# plot D
set xrange [-27.3:27.3]
set xtics auto
set ylabel ""
unset label
set label "(b)" at 0,0.60 @scaleFONT
set origin xorigin,(yorigin+0.58)
set size xsize,ysize+0.02
plot "malto23per-251-300ns_head_tail_wat2.dat" u 1:2 w filledcurves y1=0 fs transparent solid 0.35 ls 4, \
'' u 1:3 w filledcurves fs transparent solid 0.4 ls 5,\
'' u 1:4 w filledcurves fs transparent solid 0.5 ls 6
#################################################################################
# plot E
set xrange [-20.0:20.0]
set xtics auto
set ylabel ""
unset label
set label "(a)" at 0,0.60 @scaleFONT
set origin xorigin,(yorigin+0.77)
set size xsize,ysize+0.02
plot "malto12per-251-300ns_head_tail_wat2.dat" u 1:2 w filledcurves y1=0 fs transparent solid 0.35 ls 4, \
'' u 1:3 w filledcurves fs transparent solid 0.4 ls 5,\
'' u 1:4 w filledcurves fs transparent solid 0.5 ls 6
#################################################################################
## plot F
set size 0.3,0.5
set origin 0.76,0.55
set bmargin at screen 0
set key center center
set border 0
unset xlabel
unset ylabel
unset label
unset tics
set format x ""
set format y ""
set yrange [0:1]
plot 2 ls 4 t 'Head', \
2 ls 5 t 'Chain', \
2 ls 6 t 'Water'
#, \
# 2 ls 10 t '151-200ns', \
# 2 ls 13 t '201-250ns', \
# 2 ls 16 t '251-300ns'
unset multiplot
使用此代码我得到如此处所示的图。 。
我在这里遇到的问题是图中标有(a)的情节。蓝色色调必须向下。但它会向上发展。其他数字(b),(c)等是正确的。
图标签(a)的相应代码在代码中的#(PLOT E)#部分给出。特别是蓝色阴影的线条如下:(u 1:4 w fillcurves fs透明固体0.5 ls 6)。
我无法弄清楚我在这里犯的错误或错误是什么。
(注意:代码和相应数字的顺序是颠倒的)。
我感谢任何纠正此代码的帮助。非常感谢提前。
答案 0 :(得分:1)
您想要填充曲线和下X轴之间的区域。这是通过选项x1
:
plot 'file.dat' with filledcurves x1 fs transparent solid 0.5 ls 6
我认为您可以为所有区域设置x1
。