umeno wrote:

Hi,

I would like to know if anyone knows how to draw a plot with two Y-axises and one X-axis? When you have two sets of y values that do not have the same scale, but correspond to the same x value, I would like to plot them on one graph.

Could you please help me?

Please look into the help archives before asking! This question has been answered several times during the last years.


Example for a short solution:

  plot(1:10)
  par("usr")
# [1]  0.64 10.36  0.64 10.36
# Now resetting y-axis' usr coordinates:
  par(usr=c(par("usr")[1:2], 101, 105))
  points(1:5, 105:101, col="red")
  axis(4)


Uwe Ligges


______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to