When we generate a histogram in R using hist function, the x-axis labels are automatically generated but we might want to change them to values defined by researchers or by any other authority. Therefore, firstly we need to create the histogram by ignoring the labels and then axis function can be used for new values.
Consider the below vector x and create a histogram of x by ignoring x-axis labels −
set.seed(1999) x<-rnorm(5000,9,1) hist(x,xaxt='n')
Now adding new values for x-axis labels −