[R] Add y-title to a plot with two y axis

Magali teurlai teurlaimag.r at gmail.com
Mon Sep 6 01:52:18 CEST 2010


Hi all,

We managed to plot two series on the same graph, with two y-axis,
however, we haven't managed to add a title to the second y-axis

x1=rnorm(25, mean=0, sd=1)
y1=dnorm(x1, mean=0, sd=1)
x2=rnorm(25, mean=0, sd=1)
y2=dnorm(x2, mean=0, sd=1)

plot(x1, y1, type='p', xlab='x', ylab='y')
par(new=TRUE)
plot(x1, y2, type='p', axes= FALSE, col="red",ylab="", xlab="")
axis(side=4)

There are no parameters to the "axis" function to add a title.

Does anyone know how to do ?

Many Thanks in advance

Mag



More information about the R-help mailing list