- 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 display X-axis labels inside the plot in base R?
To display X-axis labels inside the plot in base R, we can follow the below steps −
First of all, create a plot without X-axis labels and ticks.
Then, display the labels inside the plot.
After that, display the ticks inside the plot.
Create the plot
Using plot function, create a plot without X-axis labels and ticks −
plot(1:10,1:10,xaxt="n",type="n")
Output
Display the axis labels inside the plot
Using text function to display the X-axis labels inside the plot −
plot(1:10,1:10,xaxt="n",type="n") text(1:10,1,1:10,cex=0.8)
Output
Display the axis ticks inside the plot
Using axis function to display the X-axis ticks inside the plot −
plot(1:10,1:10,xaxt="n",type="n") text(1:10,1,1:10,cex=0.8) axis(1,at=c(1:10),NA,cex.axis=0.8,tck=0.01)
Output
- Related Articles
- How to display X-axis labels with dash in base R plot?
- How to display superscript for X-axis title in base R plot?
- How to display raise to the power on X-axis in base R plot?
- How to create a plot with tick marks between X-axis labels in base R?
- How to display x-bar in base R plot?
- How to create a plot with reversed Y-axis labels in base R?
- How to display axes ticks and labels inside the plot using ggplot2 in R?
- How to plot the X-axis labels on the upper-side of the plot in R?
- How to display star/asterisk sign (*) inside a base R plot?
- How to use mtext function to create the X-axis labels in base R?
- How to change the position of X-axis in base R plot?
- How to X-axis labels to the top of the plot using ggplot2 in R?
- How to display positive sign for X-axis labels in R using ggplot2?
- How to display fraction in base R plot?
- How to change the axis color in base R plot?

Advertisements