Reputation:
I am plotting an axis with
a <- factor(letters[seq( from = 1, to = 26 )])
b <- 1:26
plot(a, b, axes = FALSE)
axis(1, at = a, labels = a, las = 2)
How can I get all the tick marks but only every nth label, e.g. (every 7th):
Upvotes: 3
Views: 5179
Reputation: 13372
You can call axis
twice, first to draw all tick marks and then again to put the labels:
c = a[seq(1, length(a),7)]
axis(1, at=a, labels = FALSE)
axis(1, at=c, labels = c, las = 2)
Upvotes: 1