Tal*_*ili 10 r data-visualization
我刚刚得到以下情节:

并想知道如何在R中完成?(或其他软件)
更新10.03.11:感谢所有参与回答此问题的人 - 您提供了很棒的解决方案!我在我的博客上的帖子中编译了这里提供的所有解决方案(以及我在网上发布的其他一些解决方案).
Make.Funny.Plot或多或少地做了我认为它应该做的事情.根据自己的需要进行调整,可能会有所优化,但这应该是一个不错的开始.
Make.Funny.Plot <- function(x){
unique.vals <- length(unique(x))
N <- length(x)
N.val <- min(N/20,unique.vals)
if(unique.vals>N.val){
x <- ave(x,cut(x,N.val),FUN=min)
x <- signif(x,4)
}
# construct the outline of the plot
outline <- as.vector(table(x))
outline <- outline/max(outline)
# determine some correction to make the V shape,
# based on the range
y.corr <- diff(range(x))*0.05
# Get the unique values
yval <- sort(unique(x))
plot(c(-1,1),c(min(yval),max(yval)),
type="n",xaxt="n",xlab="")
for(i in 1:length(yval)){
n <- sum(x==yval[i])
x.plot <- seq(-outline[i],outline[i],length=n)
y.plot <- yval[i]+abs(x.plot)*y.corr
points(x.plot,y.plot,pch=19,cex=0.5)
}
}
N <- 500
x <- rpois(N,4)+abs(rnorm(N))
Make.Funny.Plot(x)
Run Code Online (Sandbox Code Playgroud)
编辑:纠正,所以它总是有效.
我最近遇到了一个令人厌恶的包装,它有一些相似之处.
蜜蜂群图是像"条带图"一样的一维散点图,但是具有紧密堆积的非重叠点.
这是一个例子:
library(beeswarm)
beeswarm(time_survival ~ event_survival, data = breast,
method = 'smile',
pch = 16, pwcol = as.numeric(ER),
xlab = '', ylab = 'Follow-up time (months)',
labels = c('Censored', 'Metastasis'))
legend('topright', legend = levels(breast$ER),
title = 'ER', pch = 16, col = 1:2)
Run Code Online (Sandbox Code Playgroud)
http://www.cbs.dtu.dk/~eklund/beeswarm/beeswarm_example_03.png