tags:

views:

2597

answers:

2

Hi, i was just wondering if there was a way to get rid of axis values, either the x axis or y axis respectively, in an r-plot graph. I know that axes = false will get rid of the entire axis, but i would only like to get rid of the numering. Thanks so much!
~Sam

+2  A: 

Using base graphics, the standard way to do this is to use axes=FALSE, then create your own axes using Axis (or axis). For example,

x <- 1:20
y <- runif(20)
plot(x, y, axes=FALSE, frame.plot=TRUE)
Axis(side=1, labels=FALSE)
Axis(side=2, labels=FALSE)

The lattice equivalent is

library(lattice)
xyplot(y ~ x, scales=list(alternating=0))
Richie Cotton
+6  A: 

Remove numbering on x-axis or y-axis:

plot(1:10, xaxt='n')
plot(1:10, yaxt='n')

If you want to remove the labels as well:

plot(1:10, xaxt='n', ann=FALSE)
plot(1:10, yaxt='n', ann=FALSE)
ars

related questions