Gnuplot Histogram w/ Error Bars

老子叫甜甜 提交于 2019-12-11 03:22:32

问题


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:

What am I doing wrong?


回答1:


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)



来源:https://stackoverflow.com/questions/25550866/gnuplot-histogram-w-error-bars

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!