apple=c(1,2,3,4,5)
banana=c(5,4,3,2,1)
watermelon=c(4,5,6,7,8)
boxplot(apple, banana, watermelon)
If I were to plot this, the x-axis of the boxplot is labeled as 1, 2 and 3. How can I change those to "apple", "banana", and "watermelon," respectively? xlab=
labels the entire axis, but not the individual boxplots. Which command/option should I use?
This question is related to
r
If you read the help file for ?boxplot
, you'll see there is a names=
parameter.
boxplot(apple, banana, watermelon, names=c("apple","banana","watermelon"))
Source: Stackoverflow.com