These functions extract just the axes from a ggplot. get_y_axis()
pulls
the y-axis, while get_x_axis()
pulls the x-axis.
get_y_axis(plot, position = c("left", "right")) get_x_axis(plot, position = c("bottom", "top"))
plot | A ggplot or gtable. |
---|---|
position | Which side of the plot is the axis on? For the x-axis, this can be "top" or "bottom", and for the y-axis, it can be "left" or "right". |