我如何用不同的文件绘制 2 个箱线图? Gnuplot

How can i plot 2 boxplot with diferent files? Gnuplot

所以,我试图用不同的文件绘制两个不同的箱形图,这里是我的代码:

set boxwidth 0.5
set style fill solid 0.5
set xlabel ""
set ylabel "Boxplot Value"
set grid layerdefault
set xtics ("Data A" 1, "Data B" 2)
set xtics rotate by -50
plot "out4.txt" using (1):1 notitle with boxplot, "out20.txt" using (1):2 notitle with boxplot

并且出现此错误:"boxplot.gnu",第 8 行:警告:跳过没有有效点的数据文件

我的数据是这样排列的:

2

3

4

5

6

7

6

23

423

42

342

34

234

只有一列,两个文件中的数据相同。

如果你的文件 "out20.txt" 也只有一列,那么如果你写 "out20.txt" using (1):2 gnuplot 应该绘制什么?没有要绘制的第二列。这就是 gnuplot 告诉你的 "Skipping data file with no valid points".

如果"out4.txt"对应于x=1处的Data A"out20.txt"对应于x=2处的Data B,则将第8行改为如下应该显示您的图表:

plot "out4.txt" using (1):1 notitle with boxplot, "out20.txt" using (2):1 notitle with boxplot