来自不同数据文件的gnuplot聚集直方图

来自不同数据文件的gnuplot聚集直方图,gnuplot,histogram,Gnuplot,Histogram,我有A和B两个文件,比如: # file A # x val 1 2 1.5 3 2 4 及 如何在gnuplot中构建一个简单的聚集直方图,以便每个xtic在该点上都有一个a和B值的条 基本上,我想要的是: B B B B B AB B AB AB AB AB AB AB AB AB 1 1.5 2 您可以通

我有A和B两个文件,比如:

# file A
# x  val
1     2
1.5   3
2     4

如何在gnuplot中构建一个简单的聚集直方图,以便每个xtic在该点上都有一个a和B值的条

基本上,我想要的是:

              B
              B
       B      B
       B     AB
 B    AB     AB
AB    AB     AB
AB    AB     AB
1     1.5     2

您可以通过以下方式实现这一点:

set style fill solid
plot [0.5:][0:10] 'fileA' u 2: xtic(1) with histogram, 'fileB' u 2: xtic(1) with histogram

set style fill solid
plot [0.5:][0:10] 'fileA' u 2: xtic(1) with histogram, 'fileB' u 2: xtic(1) with histogram