Whitebeard13
Whitebeard13

Reputation: 433

Display column names in bar plot

I am recently introduced in R. I am trying to create a bar plot from a data frame with 51 variable names just like the following example:

enter image description here

By using the barplot function I produced the following bar plot. Is there a way to display the variable names on the x-axis just like the above example:

enter image description here

Thanks in advance.

Upvotes: 0

Views: 4621

Answers (1)

Alex
Alex

Reputation: 21

It can be done with cex.names argument of barplot function. cex.names determines the size for x labels, try to write 0.1 then increase by 0.1 to check for optimal size. For example:

barplot(x,names.arg = x_name,cex.names=0.4)

Upvotes: 2

Related Questions