Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianLang authored Aug 19, 2020
2 parents f764845 + 51149c6 commit cb2b138
Show file tree
Hide file tree
Showing 44 changed files with 479 additions and 263 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@ Collate:
'stamp.R'
'themes.R'
'utils_ggplot2.R'
RoxygenNote: 6.1.1
RoxygenNote: 7.1.1
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
10 changes: 9 additions & 1 deletion R/cowplot.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#' cowplot.
#' Streamlined Plot Theme and Plot Annotations for 'ggplot2'
#'
#' Provides various features that help with creating publication-quality
#' figures with 'ggplot2', such as a set of themes, functions to align
#' plots and arrange them into complex compound figures, and functions
#' that make it easy to annotate plots and or mix plots with images. The
#' package was originally written for internal use in the Wilke lab,
#' hence the name (Claus O. Wilke's plot package). It has also been used
#' extensively in the book Fundamentals of Data Visualization.
#'
#' @name cowplot
#' @docType package
Expand Down
15 changes: 10 additions & 5 deletions R/save.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,28 @@ ggsave2 <- function(filename, plot = ggplot2::last_plot(), device = NULL, path =
#' p1 <- ggplot(mpg, aes(x = cty, y = hwy, color = factor(cyl))) +
#' geom_point(size = 2) +
#' theme_half_open()
#' save_plot("p1.png", p1)
#' # same as p1 but determine base_width given base_height
#' save_plot("p2.png", p1, base_height = NULL, base_width = 6)
#'
#' file1 <- tempfile("file1", fileext = ".png")
#' file2 <- tempfile("file2", fileext = ".png")
#' save_plot(file1, p1)
#' # same as file1 but determine base_width given base_height
#' save_plot(file2, p1, base_height = NULL, base_width = 6)
#'
#' # save a single plot without legend, adjust aspect ratio
#' x <- (1:100)/10
#' p3 <- ggplot(data.frame(x = x, y = x*sin(x)), aes(x, y)) +
#' geom_line() +
#' theme_minimal_hgrid()
#' save_plot("p3.pdf", p3, base_asp = 1.1)
#' file3 <- tempfile("file3", fileext = ".pdf")
#' save_plot(file3, p3, base_asp = 1.1)
#'
#' # now combine with a second plot and save
#' p3b <- ggplot(data.frame(x = x, y = cos(x)+x), aes(x, y)) +
#' geom_line() +
#' theme_minimal_hgrid()
#' p4 <- plot_grid(p3, p3b, labels = "AUTO")
#' save_plot("p4.pdf", p4, ncol = 2, base_asp = 1.1)
#' file4 <- tempfile("file4", fileext = ".pdf")
#' save_plot(file4, p4, ncol = 2, base_asp = 1.1)
#' }
#' @export
save_plot <- function(filename, plot, ncol = 1, nrow = 1,
Expand Down
10 changes: 5 additions & 5 deletions R/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
.onAttach <- function(libname, pkgname) {
# switch the default theme to theme_cowplot
# ggplot2::theme_set(theme_cowplot())
packageStartupMessage("\n********************************************************")
packageStartupMessage("Note: As of version 1.0.0, cowplot does not change the")
packageStartupMessage(" default ggplot2 theme anymore. To recover the previous")
packageStartupMessage(" behavior, execute:\n theme_set(theme_cowplot())")
packageStartupMessage("********************************************************\n")
#packageStartupMessage("\n********************************************************")
#packageStartupMessage("Note: As of version 1.0.0, cowplot does not change the")
#packageStartupMessage(" default ggplot2 theme anymore. To recover the previous")
#packageStartupMessage(" behavior, execute:\n theme_set(theme_cowplot())")
#packageStartupMessage("********************************************************\n")
}
22 changes: 17 additions & 5 deletions man/add_sub.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions man/align_plots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions man/axis_canvas.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions man/background_grid.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions man/cowplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions man/draw_figure_label.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions man/draw_grob.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions man/draw_image.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions man/draw_label.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions man/draw_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions man/draw_plot_label.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/draw_text.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions man/ggsave2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions man/insert_xaxis_grob.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/panel_border.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cb2b138

Please sign in to comment.