expand_ylim: Adjust y-axis limits of 'ggplot2' object

View source: R/nested_loop.R

expand_ylimR Documentation

Adjust y-axis limits of ggplot2 object

Description

Set y-axis limits in a way which is useful for the output from nested_loop_plot. Makes functionality from expand_scale available.

Usage

expand_ylim(p, y_expand_limits = 0)

Arguments

p

ggplot2 object, Output from nested_loop_plot function.

y_expand_limits

A named list or a numeric vector. If a list, then the names of the list should correspond to facet panels of the plot and the entries should be numeric vectors, which apply the scale expansion only to the specified facets.

Details

Often helpful to deal with clipping issue when e.g. text is not fully displayed within the plot.

This function makes sure that any value in y_expand_limits is visible in the plot.

Value

A ggplot2 object.


matherealize/looplot documentation built on Jan. 14, 2024, 2:07 a.m.