« Return to Thread: Plotting points on line graphs using xYplot in Hmisc

Re: Plotting points on line graphs using xYplot in Hmisc

by John Poulsen-2 :: Rate this Message:

Reply to Author | View in Thread

Hello Deepayan,

Thanks for the below solution to my graphing problem - just what I
was looking for.

One quick additional question, where do I change graphical
settings (lwd, pch, etc...) for the added points?

Thanks,
John

On 5/5/08, John Poulsen <jpoulsen@...> wrote:

> >
> >
> >  Hello,
> >
> >  I am using xYplot to plot lines with confidence bands (see
> test example
> > below).  I would like to add a single point with confidence
> bars to each
> > graph (coordinates of the points below: px, py, pxlow, etc...).
>  I tried
> > playing with panel=panel.superpose, but failed to get it to
> work.  Any ideas
> > on how to add these points to the graphs?

If you want to add the same lines/points in all panels, you could
write a not-too-complicated custom panel function; e.g.,

with(dat,
     xYplot(Cbind(ycomb, y.up, y.low)~x1|factor(grp),
            data=dat,type="l",
            method="filled bands",
            col.fill="light grey",
            subscripts = TRUE,
            panel = function(...) {
                panel.xYplot(...)
                panel.segments(pxlow, pylow, pxhi, pyhi)
            },
            scales=
            list(y=list(relation="free"),
                 x=list(alternating=c(1,1,1))),
            ylim=list(c(0,1200),c(0,10000))))

-Deepayan




-------------------------------
John Poulsen
223 Bartram Hall PO Box 118525
University of Florida
Gainesville, FL 32611-8525

______________________________________________
R-help@... 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.

 « Return to Thread: Plotting points on line graphs using xYplot in Hmisc