gnuplot - 让 gnuplot 并排放置条形图

标签 gnuplot bar-chart

我有以下 gnuplot 脚本:

set autoscale
unset log
unset label
unset term
unset output
set xtics rotate by -90
set ytic auto
unset title
set xlabel "Survey metadata attribute subset"
set ylabel "Accuracy of classifier (%)"
set boxwidth 0.1
set style fill solid
set term eps
set output "metadata.eps"
plot "metadata.dat" using 1:3:xtic(2) title "PART" with boxes, \
     "metadata.dat" using 1:5:xtic(2) title "JRip" with boxes, \
     "metadata.dat" using 1:7:xtic(2) title "FURIA" with boxes

但是,这会将所有 3 组条形图绘制在彼此之上,而我希望它们并排按此顺序组合在一起。所以它应该是这样的:PARTbar、JRipbar、FURIAbar、gap、PARTbar、JRipbar、FURIAbar、gap 等。我该怎么做呢?

最佳答案

我猜你想要的是set style histogram clustered

我用最小的数据集(见底部)绘制了它

set style histogram clustered
set xtics rotate by -90
unset title
set xlabel "Survey metadata attribute subset"
set ylabel "Accuracy of classifier (%)"
set boxwidth 1
set style fill solid
set term png
set output "so.png"
plot [-0.5:2.75][1:17] "so.dat"using 3:xtic(2) title "PART" with histograms, \
     "" using 4 title "JRip" with histograms, \
     "" using 5 title "FURIA" with histograms

产生

enter image description here

我认为您可以从这里更进一步。

数据文件“so.dat”:

1   a   10  12  15
2   b   12  14  16
3   c   11  15  14

关于gnuplot - 让 gnuplot 并排放置条形图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35386969/

相关文章:

c++ - Gnuplot 持久图形窗口

r - 如何在 R 中用图案或纹理填充堆叠条形图

flutter : How to set fix width of Bar chart Column with scrolling x axis

gnuplot - 使用 gnuplot 绘制傅立叶展开式

gnuplot - Gnuplot 多图模式下的屏幕尺寸

latex - matplotlib 中的 gnuplot epslatex 功能

Fortran 未识别的对 'gplot_' 的引用

r - 在 ggplot2 中创建填充标志(或图像)的条形图

python - 为什么 matplotlib 开始绘制条形图而不是折线图

r - 组内的ggplot scale_fill_manual