Quantcast

secondary axis in a plot

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

secondary axis in a plot

maryso
Hello,
I want to do a plot of two series, but adding a secondary axis in the rigth side to take into account the different scales of the two series. Anyone can tell me haw can I do that in R?
Thank you very much
Maria
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: secondary axis in a plot

Karl Ove Hufthammer-4
MarySR:

> I want to do a plot of two series, but adding a secondary axis in the
> rigth side to take into account the different scales of the two series.
> Anyone can tell me haw can I do that in R?

I would *strongly* advice you to read this article on dual-scaled axes
before proceeding:

http://www.perceptualedge.com/articles/visual_business_intelligence/dual-scaled_axes.pdf

Anyway, your question has been answered several times in the past.
Try the search term "two axes" at "http://www.rseek.org/".

--
Karl Ove Hufthammer

______________________________________________
[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
|  
Report Content as Inappropriate

Re: secondary axis in a plot

jholtman
In reply to this post by maryso
If you need to do it:


plot(PLOT1, bty='c')
par(new=TRUE)
plot(PLOT2, axes=FALSE, ylab='', xlab='', bty='c')
axis(4)
mtext("secondary y-axis label",4)

On Thu, May 22, 2008 at 7:16 AM, MarySR <[hidden email]> wrote:

>
> Hello,
> I want to do a plot of two series, but adding a secondary axis in the rigth
> side to take into account the different scales of the two series. Anyone
> can
> tell me haw can I do that in R?
> Thank you very much
> Maria
> --
> View this message in context:
> http://www.nabble.com/secondary-axis-in-a-plot-tp17402079p17402079.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>



--
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

        [[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
|  
Report Content as Inappropriate

Re: secondary axis in a plot

Jim Lemon
In reply to this post by maryso
MarySR wrote:
> Hello,
> I want to do a plot of two series, but adding a secondary axis in the rigth
> side to take into account the different scales of the two series. Anyone can
> tell me haw can I do that in R?

Hi Maria,

Have a look at twoord.plot in the plotrix package.

Jim

______________________________________________
[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.
Loading...