library(ggplot2)
# Default skip labels
ggplot(mtcars, aes(x = mpg, y = wt)) +
geom_point() +
scale_x_continuous(labels = label_skip())
# Skip date labels, while keep ticks
ggplot(economics, aes(x = date, y = unemploy)) +
geom_line() +
scale_x_date(
date_breaks = "2 years",
labels = label_skip(start = "right", labeller = label_date(format = "%Y"))
) +
theme_bw()
Run the code above in your browser using DataLab