[R] Stacked plots with common x-axis and different y-axis

Jason Rupert jasonkrupert at yahoo.com
Wed Aug 5 22:50:01 CEST 2009


Thank you very much for providing this information.  

Within Plotrix does there also exist the possibility of having two plots share the same x-axis, but have one plot above the other plot.  That is, essentially do the same thing as twoord.plot, but instead put the right "y" values in a plot above the left "y" values. 

I'm looking for a way to make them show up above so they are a bit more separated. 

Thanks for any feedback. 

--- On Wed, 8/5/09, Jim Lemon <jim at bitwrit.com.au> wrote:

> From: Jim Lemon <jim at bitwrit.com.au>
> Subject: Re: [R] Stacked plots with common x-axis and different y-axis
> To: "Jason Rupert" <jasonkrupert at yahoo.com>
> Cc: R-help at r-project.org
> Date: Wednesday, August 5, 2009, 4:42 AM
> Jason Rupert wrote:
> > Is there a place that shows how to create two plots
> that are stacked on top of each other where they share a
> common x-axis scale, but have differnt y-axis scale?
> > 
> > Say have the following data: airquality
> > Stack plot(airquality$Day, airquality$Wind) on top
> of  plot(airquality$Day, airquality$Temp). 
> > I am interested in stacking the two on top of each
> other with no seam, or plotting the two lines with two
> different y-axis scales on the same plot.    
> Hi Jason,
> Have a look at twoord.plot in the plotrix package.
> Jim

More information about the R-help mailing list