好的,我知道了。
示例脚本:
set terminal pngcairo transparent enhanced font "arial,10" fontscale 1.0 size 500, 350
set output 'candlesticks.png'
set boxwidth 0.2 absolute
set title "Box-and-whisker plot with median bar, whiskerbars, and variable box width"
set xrange[0:5]
set yrange[0:25]
# Data columns: X Min 1stQuartile Median 3rdQuartile Max BoxWidth Titles
# set bars 4.0
set style fill empty
plot 'data.txt' using 1:3:2:6:5:7:xticlabels(8) with candlesticks title 'Quartiles' whiskerbars, \
'' using 1:4:4:4:4:7 with candlesticks lt -1 notitle
样本内容data.txt
:
# Data columns: X Min 1stQuartile Median 3rdQuartile Max BoxWidth Titles
1 5 7 10 15 24 0.3 Quick
2 6 8 11 16 23 0.4 Fox
3 5 7 11 17 22 0.5 Lazy
4 6 9 10 18 21 0.3 Dog
(请注意,#
行只是注释,我们并没有真正指定列名。)
结果: