How to set the horizontal distance between outliers in gnuplot boxplot

谁说胖子不能爱 提交于 2019-12-24 03:05:15

问题


So if i have plotted some data in gnuplot as a boxplot (set style data gnuplot), and I have outliers having the same value, then they are plotted as dots horizontally at the same place.

How can I set that horizontal distance?

So for example I have the datafile data.dat

1
1
1
1
1
1
1
1
1
1
1
1
9
9

and plot it using

set style data boxplot
plot 'data.dat' using (1):1
set yrange [0:10]

How can I set then the distance between the two points at y=9?


回答1:


No, you cannot change that distance, The position of duplicate outliers depends on the selected pointsize. There is, however, a difference in the point distance between the command

plot 'data.dat' using (1):1 

and

plot 'data.dat' using (1):1 pointsize 1.

But I suspect this shouldn't happen and might be categorized as bug.

set style data boxplot
set yrange[0:10]

plot 'data.dat' using (1):1 title 'no explicit point size',\
     '' using (2):1 pointsize 1 title 'point size 1'




回答2:


Christoph, you were on the right track, just didn't go far enough. At least with Ver. 5.0, the following worked for me:

set style boxplot outliers pointtype 6
plot 'data.dat' using (1):2:(0):1 pointsize .1

I was plotting a few thousand points, and this resulted in a much more reasonable plot, given that there could be tens of duplicates. Outliers that don't overlap



来源:https://stackoverflow.com/questions/28780544/how-to-set-the-horizontal-distance-between-outliers-in-gnuplot-boxplot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!