[R] Produce "a prism like plot"

Jim Lemon jim at bitwrit.com.au
Thu Nov 8 20:16:57 CET 2012


On 11/08/2012 11:48 PM, DusanP wrote:
> Sorry to bother you again,
>
> But I have two other questions :
>
> 1. How do I change symbols (dots) for each group?
> I tried :
>
> For group 1, n=5.
> points(x=groups[1:5],y=data[1:5],type=pch). The issue is that it doesn't
> select the right points,  or coordinates.
>
> 2. How can I increase horizontal spacing between dots from the same group
> which are at the same vertical level?  I have
> some overlapping values for replicates.
> I tried to modify "intervals" and "offset" but it doesn't work.
>
Hi Dusan,
Your first two questions are relatively easy:

library(plotrix)
data(iris)
ehplot(iris$Sepal.Length, iris$Species, intervals=20,
  cex=1.8, pch=4,median=FALSE)
irismeans<-as.vector(by(iris$Sepal.Length,iris$Species,
  FUN=mean))
segments(c(0.7,1.7,2.7),irismeans,c(1.3,2.3,3.3),irismeans)

For your third question (number 2 above) I'll have to dig into the code, 
so I may have an answer this afternoon (Sydney time).

Jim




More information about the R-help mailing list