- 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 change the Y-axis title in base R plot?
The easiest way to change the Y-axis title in base R plot is by using the ylab argument where we can simply type in the title. But the use of ylab does not help us to make changes in the axis title hence it is better to use mtext function, using which we can change the font size, position etc. of the title.
Check out the below example to understand how it can be done.
Example
Use the code given below to change the Y-axis title in base R plot −
plot(1:10)
Output
If you execute the above given code, it generates the following Output −
Add the following code to the above snippet −
plot(1:10,ylab="")
Output
If you execute the above given code, it generates the following Output −
Add the following code to the above snippet −
plot(1:10,ylab="") mtext(expression(paste( plain("Dependent Variable"))),side=2,line=4,padj=1,at=5,cex=1.2)
Output
If you execute the above given code, it generates the following Output −
- Related Articles
- How to change the axis color in base R plot?
- How to display superscript for X-axis title in base R plot?
- How to change the axis ticks color in base R plot?
- How to change the Y-axis title to horizontal using ggplot2 in R?
- How to change the position of X-axis in base R plot?
- How to change the text size of Y-axis title using ggplot2 in R?
- How to change the adjustment of the plot title using ggplot2 to align it above the Y-axis labels in R?
- How to create a plot with reversed Y-axis labels in base R?
- How to create bar plot in base R with different limits for Y-axis?
- How to change the Y-axis values in a bar plot using ggplot2 in R?
- How to change the resolution of a plot in base R?
- How to display X-axis labels inside the plot in base R?
- How to change the font size of main title of boxplot in base R?
- How to change the font size of legend in base R plot?
- How to change the background color of legend in base R plot?

Advertisements