I have a bunch of lines I want to plot using plotCI() What Id like to know is, how can I connect the points with a line and how can I print multiple lines on the same graph? -- View this message in context: http://www.nabble.com/plotCI----multiple-plots-on-same-graph-tp19435198p19435198.html Sent from the R help mailing list archive at Nabble.com.
brandon at brandoninvergo.com
2008-Sep-11 14:54 UTC
[R] plotCI -- multiple plots on same graph
1) Look into plotmeans(), a wrapper function for plotCI....it may be more appropriate for what you're looking for and one of the default options is to connect the points with lines. Otherwise you'll have to do a separate call to lines() after each plotCI() call. 2) To put multiple data sets on the same axes, you'll have to do a plotmeans/plotCI call for each data set but before the second, third, etc plot you should call par(new=TRUE) cheers, brandon On Thu, 11 Sep 2008 06:48:25 -0700 (PDT), bioinformatics_guy <wwwhitener at gmail.com> wrote:> > I have a bunch of lines I want to plot using plotCI() > > What Id like to know is, how can I connect the points with a line and how > can I print multiple lines on the same graph? > -- > View this message in context: >http://www.nabble.com/plotCI----multiple-plots-on-same-graph-tp19435198p19435198.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.
bioinformatics_guy wrote:> I have a bunch of lines I want to plot using plotCI() > > What Id like to know is, how can I connect the points with a line and how > can I print multiple lines on the same graph? >At the moment, plotCI doesn't accept a type="b" argument. I'll see if I can fix it. You might be able to use brkdn.plot if you can feed it the raw data rather than measures of central tendency and dispersion. Jim
> I have a bunch of lines I want to plot using plotCI() > > What Id like to know is, how can I connect the points with a line and how > can I print multiple lines on the same graph?You might want to have a look at ggplot2, e.g. http://had.co.nz/ggplot2/geom_errorbar.html, for an alternative way to do this. Hadley -- http://had.co.nz/
Thank you all for the help! I had a friend look at it and basically what he did was do an initial plot() of the line (which was all the mean values) and then use ylower and yupper to plot 2 addition line() which he set lyt=3 to so they would look like points. I know its a dirty hack but it worked! bioinformatics_guy wrote:> > I have a bunch of lines I want to plot using plotCI() > > What Id like to know is, how can I connect the points with a line and how > can I print multiple lines on the same graph? >-- View this message in context: http://www.nabble.com/plotCI----multiple-plots-on-same-graph-tp19435198p19455293.html Sent from the R help mailing list archive at Nabble.com.