Hi all,

This seems like a basic problem, but no amount of playing with the code has
solved it. I have a time-series data set like that shown below (only longer)
and am seeking to plot the data with filled, circular points and error bars.
I would like the error bars to be behind the points otherwise they tend to
obscure the points (especially when I have a lot of points in the actual
data set). Despite providing a fill colour for the points and using shapes
that utilize fill colours, the error bars are always placed on top of the
points. Can anyone see the error I am making? I simply want to move the
error bars so they are behind the data points.

Thanks for your help. I assume its simple...or else its a bug.

Nate


 Time      SAP Temp    SAPSE
 0.00 1.000000   25     0.000000
 0.25 1.040000   25     0.041200
0.50 1.040000   25      0.093500
0.75 1.060000   25     0.081800
1.00 1.040000   25     0.131000
1.25 1.220000   25     0.144000
1.50 1.010000   25     0.071200
0.00 1.000000   15     0.000000
0.25 1.010000   15     0.015600
 0.50 1.010000   15    0.033700
0.75 1.060000   15    0.048100
1.00 1.010000   15    0.016800
1.25 0.977000   15    0.004860
1.50 0.959000   15    0.015500
0.00 1.000000    8     0.000000
0.25 1.010000    8     0.004620
0.50 1.060000    8     0.049100
0.75 0.921000    8     0.032900
1.00 0.951000    8     0.030400
1.25 0.904000    8     0.047100
1.50 0.911000    8     0.072200

limits<-aes(ymax=NerveSurv$SAP+NerveSurv$SAPSE,ymin=NerveSurv$SAP-NerveSurv$SAPSE)

p<-ggplot(data=NerveSurv,aes(x=Time,y=SAP))

p+geom_point(aes(colour=factor(Temp), shape=factor(Temp),
fill=factor(Temp)), size=4)
+geom_errorbar(limits,width=0.2)
+xlab("Time (min)")
+xlim(c(0,50))
+ylab("Normalized Spontaneous Action Potential Rate")
+ylim(c(0,1.6))
+scale_shape_manual("Acclimation Temperature",breaks=c(8,18,25),
labels=c("25 ºC", "18 ºC", "8 ºC"),values=c(21,21,21))
+scale_fill_manual("Acclimation Temperature",breaks=c(8,18,25), labels=c("25
ºC", "18 ºC", "8 ºC"),values=c(colours()[c(173,253,218)]))
+scale_colour_manual("Acclimation Temperature",breaks=c(8,18,25),
labels=c("25 ºC", "18 ºC", "8 ºC"), values=c(colours()[c(173,173,173)]))

        [[alternative HTML version deleted]]

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

Reply via email to