Color bars in different colors for some specific values in Gnuplot

后端 未结 2 1028
谎友^
谎友^ 2021-01-14 21:35

I\'m using Gnuplot to generate a histogram but I need to color some of them in another color if the value are over/under a specific value. Eg if value < 10, color the spe

2条回答
  •  悲&欢浪女
    2021-01-14 22:25

    Given this datafile:

    1 4  green
    2 15 yellow
    3 40 red
    

    The following line works:

    plot for [color in "green red yellow"] 'test.dat' using 1:(strcol(3) eq color ? $2:NaN):(0.95) with boxes lc rgb color
    

提交回复
热议问题