无法让gnuplot填充下面的行

时间:2015-06-29 16:23:05

标签: gnuplot

我正在尝试在OS X 10.10.3下获取gnuplot 5.0,以填充此图中较低系列下方的蓝色。我为dataFileForecast using 1:4 with filledcurves above y1=0 linestyle 3行尝试了很多变化,但似乎没有任何效果。

enter image description here

这是来源:

#!/opt/local/bin/gnuplot
reset

set terminal pngcairo enhanced background "#000000" font "Lato-Light,20" linewidth 1 rounded size 2048,670
set output "10DayForecast.png"
dataFileForecast = "10DayForecast.csv"
set datafile separator ','
set timefmt "%Y-%m-%d"
stats dataFileForecast using 2:4 nooutput

freezeWarning = 32.
Yhigh = STATS_max_x + 10.
Ylow = STATS_min_y - 10.

unset key
set border linetype rgb "#666666"
set boxwidth 0.25 relative
set style fill transparent solid 0.4
set style line 1 linetype rgb "#0066CC" # freeze line
set style line 2 linetype rgb "#FFFFFF" pointtype 7 pointsize .5 # points for both high and low temp
set style line 3 linetype rgb "#000077" # fill for low temp
set style line 4 linetype rgb "#FFFF00" # rain forecast
set style line 5 linetype rgb "#770000" # fill for high temp
set style line 6 linetype rgb "#FF7777" # line for high temp
set style line 7 linetype rgb "#3377FF" # line for low temp

set label "°" right

unset mxtics
set tics textcolor rgb "#666666"

# X Axis
set xdata time 
set xtics format "%a" nomirror
set autoscale xfix
set offsets 12*60*60,12*60*60,0,0

# Y Axis
set yrange [Ylow:Yhigh]
unset ytics
if (32 > Ylow) set ytics 32,1,32 tc rgb "#FFFFFF" font ",18"
set ytics format "%2.0f°" nomirror

# Y2 Axis
set y2tics format "%2.0f%%" textcolor "#FFFF00" nomirror
set y2range [0:100]

plot dataFileForecast using 1:6 with impulses linestyle 4 axes x1y2,\
    dataFileForecast using 1:2:4 with filledcurves above linestyle 5,\
    dataFileForecast using 1:2 with lines linestyle 6,\
    dataFileForecast using 1:2 with points linestyle 2,\
    dataFileForecast using 1:2:3 with labels offset 1.75,0.5 textcolor "#FFFFFF" font ",18",\
    dataFileForecast using 1:4 with filledcurves above y1=0 linestyle 3,\
    dataFileForecast using 1:4 with lines linestyle 7,\
    dataFileForecast using 1:4 with points linestyle 2,\
    dataFileForecast using 1:4:5 with labels offset 1.75,0.5 textcolor "#FFFFFF" font ",18",\
    freezeWarning with filledcurve above y1=0 linestyle 1

这是一个数据文件:

2015-06-29,94,94°,69,69°,20.0
2015-06-30,99,99°,72,72°,0.0
2015-07-01,102,102°,73,73°,0.0
2015-07-02,96,96°,69,69°,0.0
2015-07-03,94,94°,68,68°,10.0
2015-07-04,92,92°,67,67°,0.0
2015-07-05,91,91°,63,63°,0.0
2015-07-06,91,91°,62,62°,0.0
2015-07-07,91,91°,61,61°,0.0
2015-07-08,91,91°,63,63°,0.0

我错过了什么?

1 个答案:

答案 0 :(得分:2)

我不确定,为什么这不起作用。可能是一个错误。作为解决方法,您可以在using语句中指定第三列以指示填充区域的下边界:

plot ...,\
    dataFileForecast using 1:4:(0) with filledcurves linestyle 3

这给出了输出

enter image description here

如果yrange包含此区域,则freezeWarning区域会正确绘制。