How to specify the actual x axis values to plot as x axis ticks in R

后端 未结 4 1919
太阳男子
太阳男子 2020-11-28 03:00

I am creating a plot in R and I dont like the x axis values being plotted by R.

For example:

x <- seq(10,200,10)
y <- runif(x)

plot(x,y)
         


        
4条回答
  •  粉色の甜心
    2020-11-28 03:26

    Hope this coding will helps you :)

    plot(x,y,xaxt = 'n')
    
    axis(side=1,at=c(1,20,30,50),labels=c("1975","1980","1985","1990"))
    

提交回复
热议问题