scale_y_continuous_hdx: Position scales for continuous y data
Description
scale_y_continuous_hdx() and the three variants with different trans
arguments are defaults scales for the y axis that ensures the distance
from data to the y-axis is reduced to 0, as is common throughout the HDX
data visualization guidelines. This is done by setting expand = c(0, 0).
library(ggplot2)
p <- ggplot(df_covid) +
geom_line(
aes(
x = date,
y = cases_monthly
)
)
p
# start y axis at 0p + scale_y_continuous_hdx()
p + scale_y_log10_hdx()