Graph 使用gnuplot为一个X位置绘制两个箱线图
我有两组数据A和B,每个数据的y值为x=100200300。我想创建一个图表,显示这两个数据集之间的差异。因此,这意味着对于每个x,将有两个箱线图(一个用于数据A,一个用于数据B) 例如,这就是“我的数据”中列的组织方式。 数据集AGraph 使用gnuplot为一个X位置绘制两个箱线图,graph,gnuplot,boxplot,Graph,Gnuplot,Boxplot,我有两组数据A和B,每个数据的y值为x=100200300。我想创建一个图表,显示这两个数据集之间的差异。因此,这意味着对于每个x,将有两个箱线图(一个用于数据A,一个用于数据B) 例如,这就是“我的数据”中列的组织方式。 数据集A # x=100 200 300 1 2 3 1.1 2.1 3.1 1.2 2.2 3.2 1 2 3 1.01 2.01 3.01 数据集B # x=100 200 300 6 7 9
# x=100 200 300
1 2 3
1.1 2.1 3.1
1.2 2.2 3.2
1 2 3
1.01 2.01 3.01
数据集B
# x=100 200 300
6 7 9
6.1 7.1 9.1
6.2 7.2 9.2
6 7 9
6.01 7.01 9.01
我能够使用以下方法从数据中获得两个图表:
set style fill solid 0.25 border -1
set style boxplot outliers pointtype 7
set style data boxplot
set xtics ('100' 1, '200' 2, '300' 3)
plot for [i=1:3] "A.txt" using (i):i notitle
plot for [i=1:3] "B.txt" using (i):i notitle
然而,当我将它合并为一个时,我面临着一些问题。
请帮忙 如果要将它们堆叠在彼此上方(以防它们不重叠),则可以将两个绘图合并为一个图形,并使用
plot for [i=1:3] "A.txt" using (i):i notitle,\
for [i=1:3] "B.txt" using (i):i notitle
如果它们可以重叠,您可能希望将它们与
set boxwidth 0.3
plot for [i=1:3] "A.txt" using (i-0.15):i notitle,\
for [i=1:3] "B.txt" using (i+0.15):i notitle
仅举两个例子说明如何组合这些绘图。谢谢。我犯的错误是没有使用两次指定for循环。