Calculates axis limits for a plot that are aligned with pretty breaks, ensuring that all data points are within the range and the maximum value is comfortably included, in accordance with RIVM styling. Optionally, the lower limit can be set to zero.
See also
Other ggplot2:
ro_gg_group_ticks(),
ro_gg_plot(),
ro_gg_remove_axis_gap(),
ro_gg_save(),
ro_gg_theme(),
ro_gg_y_title()
Examples
# Example with ggplot2
if (FALSE) { # \dontrun{
library(ggplot2)
data <- data.frame(x = 1:11, y = c(11:17, 5:2))
ggplot(data, aes(x, y)) +
geom_point() +
scale_x_continuous(
breaks = pretty,
limits = ro_gg_axis
) +
scale_y_continuous(
breaks = pretty,
limits = ro_gg_axis
)
} # }
