[R] Plot two graphs with different ranges in one

Mark Knecht markknecht at gmail.com
Fri Jul 3 02:43:17 CEST 2009


On 7/2/09, Rolf Turner <r.turner at auckland.ac.nz> wrote:
>
>  On 3/07/2009, at 11:29 AM, Hongwei Dong wrote:
>
>
> > Hi, I'm trying to plot two variables in one graph. One ranges between 0
> and
> > 1, while the other ranges between 50 and 500. Can I plot them in one graph
> > with similar scale?
> >
>
>  Yes you can, but DON'T!!!  Such graphs are terribly misleading and
> confusing.
>
>  But if you insist --- and be it on your own head --- see
>
> http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-base:2yaxes
>
>  Don't say I didn't warn you!
>
>         cheers,
>
>                 Rolf Turner

Add color. Make one data set red, the other blue. Colorize the y
axises appropriately. then it's reasonable and I find in some cases
useful. (Wish I knew how to do it in R...)

I agree - in black and white it's almost useless.

cheers,
Mark




More information about the R-help mailing list