[R] Over lay 2 scale in same plot

Peng, C cpeng.usm at gmail.com
Tue Sep 7 16:28:42 CEST 2010


Modified from Josh's code:

Is this you want to see?

>  barplot(-50:50) 
>  # add points into the existing plot at the coordinates set by x and y 
>  # and use a line to connect them 
>  points(x = 1:101, y = seq(from = 30, to = -20, length.out = 101), type =
> "l") 
>  # add right hand side axis labeled with different scales. You can adjust
> the 
>  # labels according to what rule you have based on the original scale of
> left hand side axis.
>  axis(4,at=seq(-40,40,20), label=seq(-4,4,2))
> 

-- 
View this message in context: http://r.789695.n4.nabble.com/Over-lay-2-scale-in-same-plot-tp2528661p2529802.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list