unbalanced_facet_axis: Add Tick Marks to an Unbalanced facet_wrap

Description Usage Arguments Author(s) References Examples

Description

Adds the tick marks to an unbalanced grouping of facet_wrap plots.

Usage

1
unbalanced_facet_axis(ggplot_obj, position = c("up", "down"))

Arguments

ggplot_obj

An unbalanced ggplot2 facet_wrap object.

position

Either "up" (match unbalanced facet's position, as is the default of ggplot2) or "down" (along bottom most axis).

Author(s)

Original by Julius (stackoverflow.com). Updated by Mikko Korpela for ggplot2 >= 2.2.0.

References

http://stackoverflow.com/a/13316126/1000343

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(2)
mtcars2 <- mtcars
mtcars2[["new"]] <- sample(LETTERS[1:7], nrow(mtcars), TRUE)

library(ggplot2)

unbalanced_facet_axis(ggplot(mtcars2, aes(x=mpg, y=hp)) +
    geom_line() +
    facet_wrap(~new, ncol=2))

unbalanced_facet_axis(ggplot(mtcars2, aes(x=mpg, y=hp)) +
    geom_line() +
    facet_wrap(~new, ncol=3), "down")

trinker/plotflow documentation built on May 31, 2019, 9:42 p.m.