- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to change the X-axis labels for boxplots created by using boxplot function in R?
When we create boxplots for multiple categories in R using boxplot function, by default the X-axis labels are represented by numbers. But we might want to express the categories by their name. In this situation, we can use names argument along with the boxplot function.
Consider the below vectors that represent different categories and create the boxplot for these categories −
Class1<-sample(101:200,1000,replace=TRUE) Class2<-sample(150:200,1000,replace=TRUE) Class3<-sample(180:200,1000,replace=TRUE) Class4<-sample(190:200,1000,replace=TRUE) boxplot(Class1,Class2,Class3,Class4)
Now create the boxplot for the above categories by displaying their names on the X-axis −
- How to change the Y axis limit for boxplot created by using ggplot2 in R?
- How to apply manually created x-axis labels in a histogram created by hist function in R?
- How to reverse the X-axis labels of scatterplot created by using ggplot2 in R?
- How to show all X-axis labels in a bar graph created by using barplot function in R?
- How to display mean inside boxplot created by using boxplot function in R?
- How to create a boxplot using ggplot2 for single variable without X-axis labels in R?
- How to change ordinal X-axis label to text labels using ggplot2 in R?
- How to display positive sign for X-axis labels in R using ggplot2?
- How to change the orientation and font size of x-axis labels using ggplot2 in R?
- How to use mtext function to create the X-axis labels in base R?
- How to change the color and size of the axes labels of a plot created by using plot function in R?
- How to increase the X-axis labels font size using ggplot2 in R?
- How to change the axes labels using plot function in R?
- How to get boxplot data for Matplotlib boxplots?
- How to change the gridlines of Y-axis on a chart created by using ggplot2 in R?