条带图中的 R 色点

R color points in stripplot

我用 lattice 包在 R 中创建了一个带状图。

stripplot(a~b, data = df)

现在我想要在特定点上使用不同的颜色。

可能吗?

问候

是的,您可以提供颜色矢量来执行此操作。这是一个例子:

A<-1:5
B<-6:10
stripplot(A~B,col=c("blue","blue","red","blue","blue"),pch=16,cex=3)