Plot two graphs with different ranges in one

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Plot two graphs with different ranges in one

Hongwei Dong
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?
 Thanks
  Harry

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Plot two graphs with different ranges in one

Rolf Turner

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

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Plot two graphs with different ranges in one

Mark Knecht
On 7/2/09, Rolf Turner <[hidden email]> 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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
markknecht@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Plot two graphs with different ranges in one

John Kane-2
In reply to this post by Hongwei Dong

Better yet use two graphs on the same page.  It is damned hard to read and understand a two axes display.

--- On Thu, 7/2/09, Mark Knecht <[hidden email]> wrote:

> From: Mark Knecht <[hidden email]>
> Subject: Re: [R] Plot two graphs with different ranges in one
> To: "Rolf Turner" <[hidden email]>
> Cc: "[hidden email]" <[hidden email]>
> Received: Thursday, July 2, 2009, 8:43 PM
> On 7/2/09, Rolf Turner <[hidden email]>
> 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
>
> ______________________________________________
> [hidden email]
> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.
>


      __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr!

http://www.flickr.com/gift/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.