Question

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.

Was it helpful?

Solution

see ?par You need the xaxt argument

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

OTHER TIPS

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)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top