Skip to content

Using sub to get captions in barplots

1 message · Richard Cotton

#
are
the
caption
A simple problem: it seems that you have linebreaks in your script in the 
middle of the ylab and sub strings.  Remove these and you should be okay.

error.bars<-function(yv,z,nn){
xv<-barplot(yv,ylim=c(0,(max(yv)+max(z))),names=nn,ylab="Total five hour 
potassium excretion (mmol)", sub= "Figure 1B: Hour 1-5 potassium 
excretion")
g=(max(xv)-min(xv))/50
for (i in 1:length(xv)) {
lines(c(xv[i],xv[i]),c(yv[i]+z[i],yv[i]-z[i]))
lines(c(xv[i]-g,xv[i]+g),c(yv[i]+z[i], yv[i]+z[i]))
lines(c(xv[i]-g,xv[i]+g),c(yv[i]-z[i], yv[i]-z[i]))
}}

Regards,
Richie.

Mathematical Sciences Unit
HSL


------------------------------------------------------------------------
ATTENTION:

This message contains privileged and confidential inform...{{dropped:20}}