LAS
LAS

Reputation: 53

How to make column labels on R barplot italic

This is probably a simple question, but how do I make just the column labels on a barchart italic, not the x-axis label, but the column labels specifically. The code I have so far is

bp = barplot(means, names.arg = c("CON", "TRI"), ylim=c(0,120), ylab="PA", xlab="M")

Upvotes: 2

Views: 2000

Answers (1)

rbatt
rbatt

Reputation: 4807

Here's one solution that is also easy to adapt for the case when you know the names ahead of time (e.g., names2use <- c("CON", "TRI") and you want to use that object to specify the names):

barplot(1:3, names.arg=c("one","two","three"), font=3, yaxt="n")
axis(2)

Upvotes: 6

Related Questions