# [R] Aligning labels to bars in barplot

Jim Lemon jim at bitwrit.com.au
Wed Jan 16 10:17:43 CET 2013

```On 01/16/2013 07:48 PM, David Arnold wrote:
> Hi,
>
> Consider:
>
> x=c(2,4,5,10,13,73)
> names(x)=c("American\nIndian",
>             "No\ncategory\nlisted",
>             "Hispanic",
>             "African-\nAmerican",
>             "Asian",
>             "White")
>          xlab="Race",
>          ylab="Percent",
>          col=rainbow(6))
>
> The labels at the bottom of the bars are aligned at the bottom of the last
> word in each bar label. How can I code it so that the labels are aligned at
> the top of the first word in each bar label?
>
Hi David,
Try this:

barpos<-barplot(x,