This may be due to a caffeine deficiency, but I can't get minor_breaks
to produce minor tick marks in ggplot2
. For example,
# Load data
data(mtcars)
# Load library
library(ggplot2)
# Create plot
p <- ggplot(data = mtcars, aes(x = wt, y = mpg))
p <- p + geom_point()
p <- p + scale_x_continuous(minor_breaks = seq(2.5, 4.5, by =1))
print(p)
This produces the following plot:
Note: no minor tick marks at 2.5, 3.5, and 4.5. There are no errors or warnings, either. Now, if I simply change minor_breaks
to breaks
, major tick marks appear at those positions as one would expect, which makes me think that my syntax is correct and just that the minor tick marks are invisible for some reason. Point out my error and be richly rewarded with e-high-fives.