带有误差线的Gnuplot条形图 [英] Gnuplot Bar chart with error bars
本文介绍了带有误差线的Gnuplot条形图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下数据
Name Value of the bar Confidence interval
A 0.62 [0.59 0.63]
B 0.64 [0.54 0.72]
C 0.51 [0.46 0.67]
D 0.33 [0.25 0.36]
我试图将其绘制为条形图,其中A,B,C和D分别标记每个条形,并带有和错误条形.
I tried to plot it as a bar chart with A,B,C and D labeling each bar and with and error bar.
通过使用
使用1绘制"my.dat"图;带框的
我只得到一个条形图.有人可以帮我吗?
plot "my.dat" using 1; with boxes
I only get a bar chart. Can someone help me?
推荐答案
如果还需要错误栏,则必须添加第二张具有 yerrorbars
绘图样式的绘图.括号在数据文件中不是很方便,因此我用 sed
命令将其删除:
If you also want errorbars, you must add a second plot with the yerrorbars
plotting style. The brackets aren't very handy in the data file, so I remove them with a sed
command:
set style fill solid
set boxwidth 0.8
set yrange [0:*]
unset key
plot "< sed 's/[][]//g' my.dat" using 0:2:xtic(1) with boxes, \
'' using 0:2:3:4 with yerrorbars lc rgb 'black' pt 1 lw 2
这篇关于带有误差线的Gnuplot条形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文