[R] Over lay 2 scale in same plot

Joshua Wiley jwiley.psych at gmail.com
Mon Sep 6 20:02:24 CEST 2010


Hi,

Looking at the picture, I think you are just talking about plotting
two datasets.  Here is an example I made up, that looks sort of like
your picture:

# make a barplot
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")

Do you have some sample data you could send us of what you are trying
to plot?  We can give more specific feedback if we have some actual
data to work with.

Hope that helps,

Josh

On Mon, Sep 6, 2010 at 9:57 AM, mamunbabu2001 <mrashid_9 at hotmail.com> wrote:
>
> Hi Everyone,
> I have two different data set in 2 different scale.
> I want to plot these two data in the same plot
> in their respective scale. So the plot will have 2 different scale.
> I have added an image below to show how it should look.
> does any bode has any idea how this can be done.
>
> 2 different y scale in same plot..??
>
> http://r.789695.n4.nabble.com/file/n2528661/2scale_ovelay.jpg
>
> Thanks in advance.
>
> Mamun
> --
> View this message in context: http://r.789695.n4.nabble.com/Over-lay-2-scale-in-same-plot-tp2528661p2528661.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/



More information about the R-help mailing list