我想可视化位图文件的不同颜色的数量。
我的数据表如下所示:
1 163073164
4 185122087
3 255242000
8 255255255
3 000162232
1 181230029
1 127127127
1 136000021
3 200191231
我想使用 gnu 绘图直方图样式用自己的颜色绘制每个颜色条。
我只是尝试使用“lc 变量”,但它不起作用。 :-(
我现在的 GNUPLOT 脚本:
set style data histograms
set boxwidth 1
set grid
set style histogram cluster gap 0
set style fill solid 1.0 border -1
set yrange [0:*]
set xrange [0:*]
set xtics border in scale 0,10 nomirror rotate by -45 offset character 0, 0, 0 left
plot "histo.dat" using 1:xticlabels(2) lc variable no title
#EOF
我收到此错误消息:
gnuplot> plot "histo.dat" using 1:xticlabels(2) lc variable no title
^
"histo.plt", line 9: Bad data on line 1
有人能给我提示或正确的命令吗?
最好的问候罗伯特
好问题。我已经成功地使用了它boxes
风格而不是histogram
您最初使用的样式。我认为这不会产生太大的影响:
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
plot "histo.dat" using ($0):1:($0):xticlabels(2) w boxes lc 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.
如果您不熟悉伪列 0,它(本质上)是数据文件中的行号。我通常不会发布这些东西的输出,但这使得一个非常丰富多彩的情节!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)