Skip to content
Prev 12325 / 398502 Next

Secondary y-axis

Dear R Users,

I have been trying to add a  secondary y-axis to an existing plot. I thought
this could be a trivial matter and have checked the Manual and Mailing List
Archive to see If I can find a solution.

It appears the suggested method by Uwe Ligges (fot from the Archive) did not
work. I am getting an error message saying the  "Error in plot.new() : axis
style "d" unimplemented". Does any one has simple a fix to this problem.

Shiham
the other hand a line plot. The y axis of the plot are different and i want
both axis (one on the right side the >other on the left side) in the plot.
How can I do this in R ?


I would try something like:


hist(....., xlim=c(.....))
par(new=TRUE)
plot(....., xaxt="n", yaxt="n", xlim=c(.....))
axis(4)

Uwe Ligges

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._