make_axes: Draw X and Y Axes on a Plot

Description Usage Arguments Value

View source: R/make_axes.R

Description

This function creates vertical and horizontal axes that may be added to a ggplot object. The intercepts for either or each may be specified. Note the axes will not appear if they fall outside the limits of your plot. This function is partly based on this StackOverflow post: https://stackoverflow.com/questions/17753101/center-x-and-y-axis-with-ggplot2

Usage

1
make_axes(p, x_int = 0, y_int = 0)

Arguments

p

A ggplot object

x_int

X-intercept of the y-axis. Defaults to 0

y_int

Y-intercept of the x-axis. Defaults to 0.

Value

A list of four geom_segment objects, each corresponding to one half-axis, that may be added to a ggplot object.


ryan-heslin/matador documentation built on Dec. 22, 2021, 8:17 p.m.