##Example data to illustrate problem:
type=c("grp1","grp2","grp1","grp3","grp3","grp3","grp4")
num=c(1,1,2,4,3,5,1)
cols=c(rep("red",5),"green","red")
library(lattice)
bwplot(num~type)
par(new=T)
stripplot(num~type,col=cols)
我喜歡box plot顯示的附加信息,但我需要由帶狀圖中彩色點傳達的信息。顯然par(new = T)不起作用,那麼我怎樣才能將這些點疊加到box plot上呢?將條紋點添加到bwplot(R中的格點圖形)
偉大的作品,謝謝! –
是一個很好的答案,雖然被「bwplot」繪製爲「異常值」的點將被「stripplot」再次繪製。如果對條紋圖使用'jitter.data = TRUE',則看起來有兩次異常值。 – mac