2014-08-28 97 views
2

我试图用Gnuplot制作条形图/直方图,但我似乎无法得到错误栏出来。Gnuplot直方图w /错误酒吧

这是我的代码:

set style data errorbars 
set style histogram errorbars gap 2 lw 1 
set style data histograms 
plot "ctcf.dat" using 2:3:3:xtic(1) 

和数据:

#Label Mean  Error 
168-B 24778.23544 33467.8754 
168-S 34067.82997 35542.62473 
168-B 22519.51553 30835.37332 
168-S 112976.1825 143760.3467 

但他们出来错误:

enter image description here

我在做什么错?

回答

2

使用错误条绘制直方图时,您只需要在using语句中只给出两列。第一列给出框的高度,第二个是±<error>

set style histogram errorbars gap 1 lw 1 
set style data histograms 
plot "ctcf.dat" using 2:3:xtic(1) 

enter image description here

+1

有什么办法在X标签居中盒子? – Charon 2014-08-28 14:37:10

+1

是的,使用'gap 1'。如果您想改变框宽,请使用例如'设置框宽0.8相对'来得到一个更小的盒子。 – Christoph 2014-08-28 14:42:42

+0

谢谢!还有一个问题:我如何为特定的盒子着色? – Charon 2014-08-28 14:43:52