[R] Title for secondary y-axis (axis(4)) in barplot?

Uwe Ligges ligges at statistik.uni-dortmund.de
Mon May 15 11:09:36 CEST 2006


Rainer M KRug wrote:

> Hi
> 
> I am using the following script to plot a barplot with a secondary axis
> in a bargplot for the line.
> It works, but I would like to have a title for the secondary y-axis on
> the right hand side of the axis - is this possible?
> 
> Rainer
> 
> 
> RainFog <- read.csv ("Climate.csv", header = TRUE, as.is=TRUE)
> PP <- array(c(RainFog$Rain, RainFog$Fog), c(16,2))
> M <- paste (RainFog$Month)
> png(filename="RainFog.png", width=960)
> barplot (t(PP), ylim=c(0,8),names.arg=M, space=0.3, ylab="precipitation
> in mm")
> lines (seq(0.8,20.3, by=1.3), RainFog$Rel.Hum./10, type="o")
> axis (4, at=seq(0, 8, by=2), labels=seq (0, 80, by=20))
> dev.off()


See ?mtext

Uwe Ligges


> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list