Suppress ticks in plot in r

陌路散爱 提交于 2019-11-27 21:34:50

问题


I want to remove labels and axis from X axis, however adding new ticks.

plot(1:10, ylab = "")
at1 <- seq(1, 10, 0.1)
axis(side = 1, at = at1, labels = FALSE)

I could not get rid of y labels.


回答1:


see ?par You need the xaxt argument

plot(1:10, ylab = "", xaxt='n')



回答2:


I am not certain what you want, but this removes the x label and uses the tick marks you are generating with at1:

plot(1:10, ylab = "", xlab="")
at1 <- seq(1, 10, 0.1)
axis(side =1, at1, labels = F)

I took the suggestion by GSee to remove the y tick marks if you also want to do that.

plot(1:10, xlab = "", ylab = "", yaxt='n')
at1 <- seq(1, 10, 0.1)
axis(side =1, at1, labels = F)


来源:https://stackoverflow.com/questions/10393076/suppress-ticks-in-plot-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!