-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
I'm seeing a misalignment between the major and minor breaks when they use different units.
df=data.frame(Date=seq(from=as.Date("2008-12-15"),
to=as.Date("2013-04-30"), by="day"))
df$y=rnorm(nrow(df))
ggplot(df) +
geom_path(aes(x=Date, y=y)) +
scale_x_date(expand=c(0, 0), breaks=date_breaks("1 year"),
labels=date_format("%Y"),
minor_breaks=date_breaks("3 months"))
If everything is defined using the same units, the breaks are aligned as expected, but in this example, the axis label marks the end, instead of beginning of the period.
ggplot(df) +
geom_path(aes(x=Date, y=y)) +
scale_x_date(expand=c(0, 0), breaks=date_breaks("12 months"),
labels=date_format("%Y"),
minor_breaks=date_breaks("3 months"))
Metadata
Metadata
Assignees
Labels
No labels