Skip to content
Prev 70637 / 398528 Next

values of bars in barplot

On 5/30/05, luc tardieu <luc_tardieu at yahoo.fr> wrote:
Here is an example you can modify:

x <- c(44,56,34,35,44,51,55)
nams <- LETTERS[1:7]
bp <- barplot(x,horiz=T,col="light blue",xlim=c(0,60))
text(30,-1.25,xpd=NA,"Networks",cex=1.5) # x title
text(-6,4,xpd=NA,"Research Areas",cex=1.5,srt=90)  # y title
text(x,bp,x,pos=4) # place numbers to right of bars
text(0,bp,nams,cex=1.2,pos=4)  # label bars right on the bars themselves