GNUPLOT Each Histogram Bar with different color

前端 未结 2 809
失恋的感觉
失恋的感觉 2021-02-08 13:07

I want to visualize the amount of different colors of a bitmap file.

My Datasheet looks like:

1 163073164
4 185122087
3 255242000
8 255255255
3 00016223         


        
2条回答
  •  醉梦人生
    2021-02-08 13:30

    I just edit something and now it works.

    set boxwidth 1
    set grid
    set style fill solid 1.0 border -1
    set yrange [0:*]
    set xrange [-.5:*]
    set xtics border in scale 0,10  nomirror rotate by -45 left
    plot "histo.dat" using ($0):1:($2):xticlabels(3) w boxes lc rgb variable notitle
                            #^boxes centered on 0,1,2,3,....
                               #^data column
                                  #^ linecolor column.  first box has linecolor corresponding to ls 0, second box has linecolor corresponding to ls 1, etc ...
                                       #^ xticlabels (apparently) come last. 
    

提交回复
热议问题