[R] To plot and to extract info from a plot

Jim Lemon drjimlemon at gmail.com
Sun Sep 20 05:44:03 CEST 2015


HI Jackson,
This might get you started:

# plot a few squiggles
plot(runif(100)+1,seq(10000,0,length.out=100),xlim=c(1,6),
 type="l",main="Squiggles by Years",
 xlab="Squiggles",ylab="Years",xaxt="n")
lines(runif(100)+2,seq(10000,0,length.out=100))
lines(runif(100)+3,seq(10000,0,length.out=100))
lines(runif(100)+4,seq(10000,0,length.out=100))
lines(runif(100)+5,seq(10000,0,length.out=100))
axis(1,at=1:5+0.5,labels=1:5)

Jim


On Sun, Sep 20, 2015 at 10:05 AM, David Winsemius <dwinsemius at comcast.net>
wrote:

>
> On Sep 19, 2015, at 3:25 PM, Jackson Rodrigues wrote:
>
> > Hi everybody,
> >
> > I need help to plot (question 1) and to extract information from another
> > plot (question 2). Could anyone help me? I will be very grateful.
> > I do not know if I could enclose a figure here, so I saved it in my
> dropbox
> > at
> >
> https://www.dropbox.com/s/97ud54886cn6u8i/figure%20for%20r%20group.jpg?dl=0
> >
> > My questions are based on this figure.
> >
> > Question 1:
> > The first figure (Figure 1) is a compilation of time series of some
> > variables that I have to plot in parallel. However, this figure was made
> in
> > adobe Illustrator because I could not plot these time series in parallel
> > directly from R. Using R, I always get one box and one y axis for each
> > plot. So, How to make a figure like this (several curves in paralel with
> 1
> > y axis, and no x axis)  in R? I am asking because i have to plot about 50
> > curves in parallel and doing it in R would save a long time.
> >
>
> Inase graphics you would plot one series with `plot()` then add additonal
> series with `lines()`
> > Question 2:
> > The second plot (Figure 2) is a smoothed curve through time in which each
> > peak indicates an independent event. I would like to know when exactly on
> > time (x axis) each one of these peaks ocurred. So, how to intercept the x
> > axis at the maximum value of a peak.
>
> This looks like a densityplot. There are methods in all three R 2-D
> graphics paradigms.
>
>
> If you need worked examples you need to provide data. Learn to use dput()
> for that purpose.
>
> --
> >
> > I appreciate any help.
> >
> > Jackson Rodrigues
> >
> >       [[alternative HTML version deleted]]
>
> And do read the Posting guide. This is a plain text mailing list.
>
> > ______________________________________________
> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>
> David Winsemius
> Alameda, CA, USA
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list