Search code examples
rlattice

R color points in stripplot


i created one stripplot in R with lattice package.

stripplot(a~ b, data = df)

Now i want a different colour in a specific point.

Is it possible?

Greetings


Solution

  • Yes, you can provide a vector of colors to do this. Here is an example:

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

    enter image description here