[R] misalignement of secondary axis in multhist

Angel Marley angel_nauti at yahoo.com
Fri Sep 19 15:03:28 CEST 2008


Hi everybody,
I'm trying a multiple histogram, and I'd like to add on it a secondary axis with a line (cumulative frequencies, or wathever lines), and the 0 intercept doesnt coincide in y1 and y2, which dificult interpretation and makes presentation not nice. I had seen some related answer for boxplot, but I could not understand the code. Is there any general solution?
Thanks in advance
Angel
   
#example ploting a line in a multhist
a <- rnorm(100)
b<- rnorm(100)
x<- list(a,b)

require(plotrix)
multhist(x)
par(new = TRUE)
plot(-2:2, 0:4, xaxt = "n", yaxt = "n", xlab="", ylab="",type ="l")#see #difference in 0 in y1 and y2
axis(4)



More information about the R-help mailing list