I'm plotting a cdf of some data, and I've added logarithmic scale on the "x" axis. The ticks spacing is exactly as I want it to be, but I'd like to be able to add some tick marks on specific points.
I don't want to change the distribution of the ticks in my plot, from n by n
to m by m
, I want simply to have, among the ticks from n by n
, some further tick marks on some values.
I'd like to have it reflected in both x
and y
axis, so that I can fit a grid into these new marks throughout the graph.
So far I have the graph, and the grid -- I don't mind about having the grid behind or upon the graph, I just want to add some custom ticks.
# Cumulative Distribuition
pdf("g1_3.pdf")
plot(x = f$V2, y = cumsum(f$V1), log = "x", pch = 3,
xlab = "Frequency", ylab = "P(X <= x)",
panel.first = grid(equilogs = FALSE))
axis(1, at = c(40, 150))
abline(h = 0.6, v = 40, col = "lightgray", lty = 3)
abline(h = 0.6, v = 150, col = "lightgray", lty = 3)
dev.off()
UPDATE: The graph I have so far:
?axis
and?grid
. – Rolanddev.off()
), you would see that it would add ticks to the bottom axis (the first, orside
, argument, is equal to 1) at x-locations 3, 25, and 345 ... – Ben Bolker