【发布时间】:2015-06-05 20:03:04
【问题描述】:
我有大量数据点。我尝试用箱线图绘制它们,但一些异常值是完全相同的值,并且它们表示在彼此相邻的一条线上。我找到了How to set the horizontal distance between outliers in gnuplot boxplot,但这并没有太大帮助,因为这显然是不可能的。
是否可以将异常值分组在一起,打印一个点,然后在其旁边的括号中打印一个数字以指示有多少个点?我认为这会使它在图表中更具可读性。
关于信息,我有一个 x 值的三个箱线图,然后在一个图中乘以六个。我正在使用 gnuplot 5,并且已经使用了 pointsize,这不再减少距离。 希望能帮到你!
编辑:
set terminal pdf
set output 'dat.pdf'
file0 = 'dat1.dat'
file1 = 'dat2.dat'
file2 = 'dat3.dat'
set pointsize 0.2
set notitle
set xlabel 'X'
set ylabel 'Y'
header = system('head -1 '.file0);
N = words(header)
set xtics ('' 1)
set for [i=1:N] xtics add (word(header, i) i)
set style data boxplot
plot file0 using (1-0.25):1:(0.2) with boxplot lw 2 lc rgb '#8B0000' fs pattern 16 title 'A'
plot file1 using (1):1:(0.2) with boxplot lw 2 lc rgb '#00008B' fs pattern 4 title 'B'
plot file2 using (1+0.25):1:(0.2) with boxplot lw 2 lc rgb '#006400' fs pattern 5 title 'C'
for [i=2:N] plot file0 using (i-0.25):i:(0.2) with boxplot lw 2 lc rgb '#8B0000' fs pattern 16 notitle
for [i=2:N] plot file1 using (i):i:(0.2) with boxplot lw 2 lc rgb '#00008B' fs pattern 4 notitle
for [i=2:N] plot file2 using (i+0.25):i:(0.2) with boxplot lw 2 lc rgb '#006400' fs pattern 5 notitle
使用此代码实现它的最佳方法是什么?
【问题讨论】: