plotflow (version 0.2.1)

unbalanced_facet_axis: Add Tick Marks to an Unbalanced facet_wrap

Description

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

Usage

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).

References

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

Examples

Run this code
# NOT RUN {
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")
# }

Run the code above in your browser using DataLab