The code below produces the plot hosted here:
http://www.span-lab.com/ChartStop.jpeg

    error.bar <- function(x, y, upper, lower=upper, length=0.1,...){
    if(length(x) != length(y) | length(y) !=length(lower) | length(lower) != length(upper))
    stop("vectors must be same length")
    arrows(x,y+upper, x, y-lower, angle=90, code=3, length=length, ...)
    }

Means<-tapply(data$IntercourseIntention,data$FilmAndOrder,mean)
SDs<-tapply(data$IntercourseIntention,data$FilmAndOrder,sd)
b<-barplot(Means,col=c("gray","tan1","blue","white"),axis.lty=1,ylim=c(2,3),names.arg=c("","","",""),ylab="Intercourse intention",xlab="Film and condition")
legend("topleft",c("Pre drink, Neutral","Post drink, Neutral","Pre-drink, Sexual", "Post-drink, Sexual"),col=c("gray","tan1","blue","white"),pch=15)
error.bar(b,Means, 1.96*SDs/10)

(I know it's not pretty yet. To be fixed after the initial display is reasonable!) The y average value minimum truly is 1.2, but even ylim=c(1,X) produces this behavior of the bars running over the x-axis. I should be able to specify the starting value regardless of the range. Does anyone see the code bit I'm missing here?

Much appreciated!

Nikky

****************************
Nicole Prause, PhD
Research faculty
Department of Psychiatry
760 Westwood Blvd
University of California
Los Angeles, CA 90024
nprause@mednet.ucla.edu<mailto:nprause@mednet.ucla.edu>
www.span-lab.com<http://www.span-lab.com>

________________________________

IMPORTANT WARNING: This email (and any attachments) is o...{{dropped:12}}

