Skip to content
Prev 295870 / 398503 Next

question how to add Standard Deviation as "Whiskers" in a simple plot

On May 28, 2012, at 9:55 AM, gianni lavaredo wrote:

            
If you tried lines() usin either sdUP or sdDOWN you saw nothing  
because the ylim was set by default using ony hte information in the  
mean vector.

Try:

 > plot(mydata$mean,
+    type="o",
+    ylab="mean",
+    xlab="class", ylim=range(c(mydata$sdUP, mydata$sdDOWN)))
 > lines(mydata$sdDOWN, col="blue", lty=3)
 > lines(mydata$sdUP, col="blue", lty=3)