在gnuplot中相互叠加绘制两种不同类型的柱状图

在gnuplot中相互叠加绘制两种不同类型的柱状图,gnuplot,histogram,Gnuplot,Histogram,我正在使用gnuplot中的直方图,我想在其他结果后面放置一个直方图条。我希望参考条(Mörk spennubjögunar>200 kV)位于其他直方图条后面。在使用不同的y轴之前,我已经在excel中完成了这项工作,在gnuplot中是否有一种很好的方法来完成这项工作 这是我目前正在使用的代码 set terminal pngcairo transparent nocrop enhanced size 3200,2400 font "arial,40" set output "Harmo

我正在使用gnuplot中的直方图,我想在其他结果后面放置一个直方图条。我希望参考条(Mörk spennubjögunar>200 kV)位于其他直方图条后面。在使用不同的y轴之前,我已经在excel中完成了这项工作,在gnuplot中是否有一种很好的方法来完成这项工作

这是我目前正在使用的代码

set terminal pngcairo transparent nocrop enhanced size 3200,2400 font "arial,40" 
set output "Harmonic_currents_BRE.png"
set key right

set datafile separator ";"

set style line 12 lc rgb '#808080' lt 0 lw 1
set style line 13 lt 0 lw 3
set grid back ls 12

set xrange [-1:20]
set yrange [0:8]
set style data histogram
set style histogram cluster gap 1
set style fill solid border 0
set border lw 2
set boxwidth 0.7

set ylabel "Hlutfall af nafnspennu [%]"
set xlabel "Tíðni [pu 50 Hz base]"


plot "case0.csv"  using 2:xticlabels(1) title 'Tilfelli 0',\
     "case1.csv"  using 2:xticlabels(1) title 'Tilfelli 1',\
     "case2.csv"  using 2:xticlabels(1) title 'Tilfelli 2',\
     "case3.csv"  using 2:xticlabels(1) title 'Tilfelli 3',\
     "ref.csv"    using 2:xticlabels(1) title 'Mörk spennubjögunar > 200 kV'

unset output
unset zeroaxis
unset terminal

我认为,最好的方法是首先用固定箱宽的方框绘制参考
(我使用了
0.9
),然后绘制聚集直方图:

set style data histogram
set style histogram cluster gap 1
set style fill solid noborder
set boxwidth 0.7

plot "ref.csv" using 0:2:(0.9):xtic(1) with boxes title 'Mörk spennubjögunar > 200 kV',\
     for [i=0:3] sprintf("case%d.csv", i) u 2 title sprintf('Tilfelli %d), i)

我认为,最好的方法是首先用固定箱宽的方框绘制参考
(我使用了
0.9
),然后绘制聚集直方图:

set style data histogram
set style histogram cluster gap 1
set style fill solid noborder
set boxwidth 0.7

plot "ref.csv" using 0:2:(0.9):xtic(1) with boxes title 'Mörk spennubjögunar > 200 kV',\
     for [i=0:3] sprintf("case%d.csv", i) u 2 title sprintf('Tilfelli %d), i)

您好,谢谢您的回复,我正在使用gnuplot 5,当我尝试使用此方法时,它会变为errorbars:“此打印样式不适用于3列。设置为yerrorbars”Uargh,是,我错过了ref图的带有方框的中间部分
。感谢您的回复,我正在使用gnuplot 5,当我尝试使用此方法时,它会变为errorbars:“此打印样式不适用于3列。设置为yerrorbars”Uargh,是的,我错过了ref图的带有方框的中间部分