gnuplot x标签在直方图中的位置
我有以下数据:gnuplot x标签在直方图中的位置,gnuplot,histogram,Gnuplot,Histogram,我有以下数据: t_4 24 3 0 0 t_6 37 4 0 0 t_8 51 4 2 0 t_4 15 1 0 0 t_6 21 0 0 1 t_8 30 0 0 1 t_4 13 2 1 0 t_6 20 3 1 0 t_8 22 4 1 0 我试着用这个修改版本的代码制作一个类似的直方图: set style data histogram set style histogram rowstacked set style fill solid set boxwidth 0.5 se
t_4 24 3 0 0
t_6 37 4 0 0
t_8 51 4 2 0
t_4 15 1 0 0
t_6 21 0 0 1
t_8 30 0 0 1
t_4 13 2 1 0
t_6 20 3 1 0
t_8 22 4 1 0
我试着用这个修改版本的代码制作一个类似的直方图:
set style data histogram
set style histogram rowstacked
set style fill solid
set boxwidth 0.5
set key invert samplen 0.2
set key samplen 0.2
set bmargin 3
set offset 0,2,0,0
set title "number of multiple resonances"
plot newhistogram "1:j" lt 1, \
'stack+cluster.dat' index 0 u 2:xtic(1) title "one", \
'' index 0 u 3 title "two", \
'' index 0 u 4 title "three", \
'' index 0 u 5 title "four"
newhistogram "2:j" lt 1, \
'stack+cluster.dat' index 1 u 2:xtic(1) notitle, \
'' index 1 u 3 notitle, \
'' index 1 u 4 notitle, \
'' index 1 u 5 notitle
newhistogram "3:j" lt 1, \
'stack+cluster.dat' index 1 u 2:xtic(1) notitle, \
'' index 1 u 3 notitle, \
'' index 1 u 4 notitle, \
'' index 1 u 5 notitle
但这是我找到的输出
正如您所看到的,问题在于x标签名称newhistogram“1:j”
,“2:j”
和“3:j”
:我只能看到“1:j”并与“t_4…”重叠
有人能帮帮我吗?那个脚本出错了!所有命令必须属于一个
绘图
命令。正如您所看到的,脚本在第二个newhistogram
之前终止
下一件事是,您需要用两个空行分隔两个块,以便使用index
参数对它们进行寻址(有关这一点,请参见数据文件中的注释,它属于您所讨论的示例)
通过这些更正,您可以得到以下脚本(请注意标题偏移量
):
结果如下(见第4.6.5节):
我一眼就不清楚。神奇之处在于:设置样式直方图行堆叠标题偏移量0,-1
set style data histogram
set style histogram rowstacked title offset 0,-1
set style fill solid
set boxwidth 0.5
set key invert samplen 0.2
set key samplen 0.2
set bmargin 3
set offset 0,2,0,0
set title "number of multiple resonances"
plot newhistogram "1:j" lt 1, \
'stack+cluster.dat' index 0 u 2:xtic(1) title "one", \
'' index 0 u 3 title "two", \
'' index 0 u 4 title "three", \
'' index 0 u 5 title "four",\
newhistogram "2:j" lt 1, \
'stack+cluster.dat' index 1 u 2:xtic(1) notitle, \
'' index 1 u 3 notitle, \
'' index 1 u 4 notitle, \
'' index 1 u 5 notitle,\
newhistogram "3:j" lt 1, \
'stack+cluster.dat' index 1 u 2:xtic(1) notitle, \
'' index 2 u 3 notitle, \
'' index 2 u 4 notitle, \
'' index 2 u 5 notitle