How to remove Y-axis labels in R?


When we create a plot in R, the Y-axis labels are automatically generated and if we want to remove those labels, the plot function can help us. For this purpose, we need to set ylab argument of plot function to blank as ylab="" and yaxt="n" to remove the axis title. This is a method of base R only, not with ggplot2 package.

Example

x<-rnorm(10)
y<-rnorm(10)
plot(x,y)

Output

Example

plot(x,y,ylab="",yaxt="n")

Output

Updated on: 06-Feb-2021

11K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements