Skip to content
Prev 360994 / 398502 Next

x-axis tick marks on log scale plot

Hi,

I have a plot with log scale on the axes. How do I add ticks and labels in
addition to the ones provided by default? Can I specify where I want the
ticks and labels?

For example:

set.seed(12345)
x <- sample(1:10000,10)
y <- sample(1:10000,10)

plot(x,y,log="xy")


For me, this plot has tick marks (and labels) at 2000, 4000, 6000, 8000.
How can I make the axes so that it has marks and labels at 1000 intervals
(i.e. 2000, 3000, 4000, etc.)

thanks!