I saw the ideal tick-mark structure for a log=\"y\"
plot in this paper, Figure 3b 3c 3d.
It has short, log-spaced minor tick marks without labels, plus long
For ggplot2
, it seems that the only option you have for specifying ticks is the size
(i.e., width).
# A plot of any old data
dfr <- data.frame(x = 1:100, y = rlnorm(100))
p <- ggplot(dfr, aes(x, y)) +
geom_point() +
scale_y_log10(breaks = breaks, labels = breaks)
#Tick locations
get_breaks <- function(x)
{
lo <- floor(log10(min(x, na.rm = TRUE)))
hi <- ceiling(log10(max(x, na.rm = TRUE)))
as.vector(10 ^ (lo:hi) %o% 1:9)
}
breaks <- get_breaks(dfr$y)
log10_breaks <- log10(breaks)
#Some bigger ticks
p + opts(axis.ticks = theme_segment(
size = ifelse(log10_breaks == floor(log10_breaks), 2, 1)
))