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


Advertisements