user2679447
user2679447

Reputation: 215

How do I make the y-axis values bold in R?

I have a box plot and want to make the values of the y-axis bold. I know how to make the y-axis title bold.

Upvotes: 7

Views: 19691

Answers (2)

agstudy
agstudy

Reputation: 121608

Using lattice

 library(lattice)
 bwplot(~1:10,scales=list(x=list(font=2,cex=5)))

enter image description here

Upvotes: 3

Sven Hohenstein
Sven Hohenstein

Reputation: 81733

Use par:

par(font.axis = 2) # 2 means 'bold'
boxplot(1:10)

An alternative way using axis (proposed by @joran):

boxplot(1:10, yaxt = "n") # suppress y axis
axis(side = 2, font = 2)  # 'side = 2' means y axis

enter image description here

You can reset to normal typeface using par(font.axis = 1).

Upvotes: 12

Related Questions