【问题标题】:Set background of boxes in boxplot to a specific color with gnuplot使用gnuplot将boxplot中框的背景设置为特定颜色
【发布时间】:2017-05-31 14:06:23
【问题描述】:

我有以下数据:

# id       min  1st quart     median  3rd quart        max          sum    std-dev name
  1    0.00029    0.02590    0.06331    0.12910    6.50177   1524.58705    0.13483 spec
  2    1.50041    1.59762    1.67226    1.79827   13.45151  26583.69935    0.48373 schema
  3    0.00206    0.01292    0.02505    0.09679  116.93156   5337.36854    2.06006 truss

还有以下 gnuplot 脚本:

set terminal png enhanced background rgb 'white' size 1920,1200 font "Verdana 10"
set output "charts/summary.png"
set boxwidth 0.2 absolute
set title "Validating all data"
set xrange[0:4]
set yrange[0.00005:50]
set logscale y
set grid y

set tics scale 0
set xtics rotate by -45
set xtics nomirror
set ytics nomirror
set border 2

set style fill solid 0.25 border -1
set style data boxplot


plot "data/summary" using 1:3:2:6:5:(0.6):xticlabels(9) with candlesticks title 'Quartiles' whiskerbars, \
         ''         using 1:4:4:4:4:(0.6) with candlesticks lt -1 notitle

输出如下:

问题是我不知道如何设置箱线图中方框的背景颜色。我似乎只能通过删除set style fill solid 0.25 border -1 行来打开和关闭填充颜色。

【问题讨论】:

    标签: colors gnuplot


    【解决方案1】:

    虽然关键字的名称不建议这样做,但linecolor 似乎会影响框的颜色,例如:

    plot "data/summary" using 1:3:2:6:5:(0.6):xticlabels(9) with candlesticks lc rgb 'blue' title 'Quartiles' whiskerbars, \
        ''         using 1:4:4:4:4:(0.6) with candlesticks lt -1 notitle
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-22
      • 2011-10-19
      • 1970-01-01
      • 2014-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-21
      相关资源
      最近更新 更多