Is it possible to make every Nth tick on an axis bold using ggplot2? I only want to have the axis tick bold (the small line), not the text.
This would be useful for high
You can try:
ggplot(df, aes(x=date, y=value, color=variable)) +
geom_line() +
scale_color_manual(values = c("#00ba38", "#f8766d")) +
scale_x_date(date_breaks = "1 year", date_labels ="%Y") +
theme(axis.ticks.x = element_line(colour = "black", size = c(5, rep(1,5))),
axis.text.x = element_text(angle = 90, vjust=0.5, size = c(15,rep(8,5))))
used every 6th
and text size for illustration purposes.
You can also use your breaks and labels but then you have to use following instead as you duplicated all breaks and labels and they must priorly removed.
scale_x_date(labels = lbls[!duplicated(lbls)], breaks = brks[!duplicated(lbls)])