It should be very easy I guess but I did not find an answer anywhere.

I have boxplots where I want the categories to consist of two lines (category name and the sample size):

names(cArea) = c("Category 1\n(n=20)","Category 2\n(n=156)","Category 3\n(n=100)")

boxplot(cArea, col="grey", lty=1, lwd=2, main="Test", xlab="Categories", ylab="Value")

box(lwd=2)

How can I make it such that it is displayed correctly (without the text overlaying the x-axis)?

Similar questions and discussions