Gnuplot Histogram w/ Error Bars

2019-07-20 03:27发布

I'm trying to make a bar chart /histogram with Gnuplot but I cant seem to get the error bars to come out.

This is my code:

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)

and data:

 #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

But they come out wrong:

enter image description here

What am I doing wrong?

1条回答
该账号已被封号
2楼-- · 2019-07-20 04:13

When plotting histograms with errorbars you need to give only two columns in the using statement. The first column gives the box height, the second one is ±<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

查看更多
登录 后发表回答