- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 use mtext function to create the X-axis labels in base R?
The mtext function can help us to create X-axis or Y-axis labels and we can put these labels to places desired by us with the help of at argument. For example, if we want to use capital letters starting from A to J that are 10 characters on the X-axis labels then it can be done by using the below command −
mtext(text=LETTERS[1:10],outer=FALSE,side=1,las=1,at=1:10)
Example
> plot(1:10,xaxt="n")
Output
Example
> mtext(text=LETTERS[1:10],outer=FALSE,side=1,las=1,at=1:10)
Output
- Related Articles
- How to display X-axis labels inside the plot in base R?
- How to create a plot with tick marks between X-axis labels in base R?
- How to display X-axis labels with dash in base R plot?
- How to create a dendrogram without X-axis labels in R?
- How to create a plot with reversed Y-axis labels in base R?
- How to create boxplot in base R without axes labels?
- How to create pie chart in base R with labels?
- How to change the X-axis labels for boxplots created by using boxplot function in R?
- How to create a plot in base R with dates sequence on X-axis?
- How to create a boxplot using ggplot2 for single variable without X-axis labels in R?
- How to apply manually created x-axis labels in a histogram created by hist function in R?
- How to increase the X-axis labels font size using ggplot2 in R?
- How to X-axis labels to the top of the plot using ggplot2 in R?
- How to remove Y-axis labels in R?
- How to show all X-axis labels in a bar graph created by using barplot function in R?

Advertisements