Skip to content

Commit

Permalink
Merge pull request #79 from sjfox/master
Browse files Browse the repository at this point in the history
cowplot map theme
  • Loading branch information
clauswilke authored Oct 25, 2017
2 parents e743b1e + aa78e08 commit ed2b5ba
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions R/themes.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,25 @@ theme_nothing <- function(base_size = 14, base_family = ""){
)
}

#' Create a theme for map plotting
#'
#' The theme created by this function is useful for plotting maps with cowplot default sizing.
#' @param base_size Overall font size. Default is 14.
#' @param base_family Base font family.
#' @return The theme.
#' @examples
#' usa_data = map_data("usa")
#' ggplot(usa_data, aes(long, lat, group=region)) + geom_polygon() + theme_map()
#' ggplot(usa_data, aes(long, lat, fill = region)) + geom_polygon() + theme_map()
#' ggplot(usa_data, aes(long, lat, fill = region)) + facet_wrap(~region, scales = "free") + geom_polygon() + theme_map()
#' @export
theme_map <- function(base_size = 14, base_family = ""){
# work based off of theme_void
theme_void(base_size = base_size, base_family = base_family)
}



#' Add/modify/remove the background grid in a ggplot2 plot
#'
#' This function provides a simple way to modify the background grid in ggplot2. It
Expand Down

0 comments on commit ed2b5ba

Please sign in to comment.