Skip to content
Prev 310478 / 398506 Next

Labeling position barchart

On 11/09/2012 10:33 PM, Geophagus wrote:
Hi GeO,
At a rough guess, you want the _bottoms_ of the labels 0.08 user units 
above the tops of the bars. It is very unlikely that the values of 
BE_AKT$ammo (is that the 5.45 or the old 7.62?) will be valid for both x 
and y coordinates. What you probably want to do is collect the x 
positions from the initial plot:

xpos<-barplot(...)

then combine those with the y positions of your values for BE_AKT$ammo:

text(xpos,BE_AKT$ammo + 0.08,label=BE_AKT$ammo,family="Calibri",pos=3)

Notice that "pos=3" argument. This places the text above the 
coordinates. You can also do this with the "adj" argument.

Jim