我正在尝试创建一个具有多个堆叠直方图的图,如示例 8here http://gnuplot.sourceforge.net/demo/histograms.html。但对于我的数据来说,每组都有相同的四个类别。
如何更改颜色和键,以便每个堆叠列的颜色变为红色、绿色、蓝色、粉色?那么我正在绘制的 4 件事中,钥匙只有一份副本?
这是我用来绘制的线:
plot newhistogram "1", 'addresses.dat' using 2:xtic(1) t 2, '' u 3 t 3, \
'' u 4 t 4, '' u 5 t 5, newhistogram "2", '' u 6 t 6, '' u 7 t 7, '' u 8 t 8,\
'' u 9 t 9
我的数据与上面链接的示例的格式相同:
Address PAL_Code BASH App Kernel PAL_Code BASH App Kernel
FFT 1 1 2 2 1 1 3 4
RADIX 1 2 3 4 1 2 4 5
LU 1 3 4 5 1 3 5 6
如果您能提供帮助,非常感谢!
use the lt
newhistogram 后面的说明符用于指定 gnuplot 应使用的第一个颜色。我写了一个小脚本,可能会满足您的要求;)
set style data histogram
set style histogram rowstack gap 1
set style fill solid border -1
set boxwidth 0.9
set key autotitle columnheader
set key outside below center horizontal
plot newhistogram "1" lt 1, 'addresses.dat' u 2:xtic(1), '' u 3, '' u 4, '' u 5,\
newhistogram "2" lt 1, 'addresses.dat' u 6:xtic(1) notitle, '' u 7 notitle, \
'' u 8 notitle, '' u 9 notitle
希望有帮助
Cherio
Woltan
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)