Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在gnuplot中将错误条添加到直方图_Gnuplot_Histogram - Fatal编程技术网

在gnuplot中将错误条添加到直方图

在gnuplot中将错误条添加到直方图,gnuplot,histogram,Gnuplot,Histogram,我有一个像这样的数据文件 #col 1 2 3 4 5 6 7 #bench #these are max and min values #mark #bar1 #bar2 #for the prevoius 2 values NOSHARE.2 43032 139412 100 45000 130000 140000 FALSE_SHARE.2 7035 24101 5000 7500 24100 2

我有一个像这样的数据文件

#col 1     2     3     4     5     6     7
#bench                 #these are max and min values 
#mark     #bar1 #bar2  #for the prevoius 2 values 
NOSHARE.2 43032 139412 100 45000 130000 140000
FALSE_SHARE.2 7035 24101 5000 7500 24100 25000
SHAREDVAR.2 11316 10248 10000 12000 10000 12000
我可以使用gnuplot生成一个图,如下所示

我需要将最大值和最小值作为错误条添加到每个条中

这是我的gnuplot脚本

set output "truevsfalse.png"
set title " TRUE VS FALSE SHARING "
set boxwidth 0.9 absolute
set style fill   solid 1.00 border lt -1
set key inside right top vertical Right noreverse noenhanced autotitles nobox
set style histogram clustered gap 5 title  offset character 0, 0, 0
set datafile missing '-'
set style data histograms
set xtics border in scale 0,0 nomirror rotate by -45  offset character 0, 0, 0
set xtics  norangelimit
set ylabel "NUMBER      OF      SHARING"
set xlabel "BENCHMARK"
plot 'truevsfalse.dat'  using 2:xtic(1)  title "true(synced and nonsynced)sharing (both vcpus)" , '' u 3   title "false sharing (both vcpus)"
我试过这个

plot 'truevsfalse.dat'  using($0- .05):2:4:5:xtic(1) with boxerrorbars  title "true(synced and nonsynced)sharing (both vcpus)" , '' using ($0+0.25):3:6:7 with boxerrorbars  title "false sharing (both vcpus)"
但是失败了,我要么只得到没有直方图条的错误条,要么尝试修改一点,图像就会损坏。
我在做什么


感谢

基本上,您需要覆盖直方图和错误条形图,但是,我发现问题在于使用
xtic(1)
,这使得在方框图上覆盖错误条形图变得很困难

set xtics ('NOSHARE.2' 0, 'FALSE_SHARE.2' 1, 'SHAREDVAR.2' 2)
set bs 0.2 # width of a box
plot 'junk' u ($0-bs/2):2:(bs) w boxes title "true(synced and nonsynced)sharing (both vcpus)", \
     'junk' u ($0-bs/2):2:4:5 w yerror notitle, \
     'junk' u ($0+bs/2):3:(bs) w boxes title "false sharing (both vcpus)", \
     'junk' u ($0+bs/2):3:6:7 w yerror notitle

我可能已经回答了一个类似的问题。( ). 那是你想要的样子吗?