Skip to content

plotCI line types for line and for bar

5 messages · Tim, Ben Bolker

Tim
#
Hi,
I was wondering how to specify the line type for line instead of for bar.
Here is my code:
"plotCI(x=mcra1avg, uiw=stdev1, type="l",col=2,lty=2)"
This way, I will have the bar line as dashed "lty=2" and red "col=2", and
the line connecting the centers of the bars is also red "col=2" but solid 
"lty=1". How to make the line connecting the bar centers have the same solid
lty as the bar?
Thanks and regards!
Tim
#
Anyone has some clue to this question?
Thanks in advance!
lehe wrote:

  
    
#
Anyone has some clue to this question?
Thanks in advance!
lehe wrote:
You neglected to say that you were using the plotCI from gplots (not the
one from plotrix, which has slightly different behaviors).  Here's my
solution (with some data made up -- you didn't give a reproducible example).
I assume that you meant above that you wanted the line connecting the
centers to be dashed?

mcra1avg <- 1:3
stdev1 <- c(0.2,0.1,0.4)
library(gplots)
plotCI(x=mcra1avg, uiw=stdev1, type="p",col=2,lty=2)
lines(mcra1avg,col=2,lty=2)

  By the way, it's not all uncommon to have to wait more than 12 hours for a
response on the R list -- the variability is very high ... I would say it's
generally good to wait at least 24 hours before "bumping" ... 

  Ben Bolker
Tim
#
Thank you!
Yes, I am using the plotCI from gplots and I want the line connecting the
centers to be dashed, just as for the bars. However changing the type to be
"p" as you said does not give dashed line but no line at all (only points).
lehe wrote:

  
    
#
lehe wrote:
Yes, but the next line

lines(mcra1avg,col=2,lty=2) 

adds a line with the desired line type.
Perhaps one idea about R graphics that would be useful to you is that one
often builds
up a desired plot by adding pieces sequentially, rather than finding a
single plot
command that does everything at once.

  Ben Bolker