Skip to content

Commit

Permalink
Fix multiple = TRUE default for cyto_plot non-PDF.
Browse files Browse the repository at this point in the history
  • Loading branch information
djhammill committed Apr 1, 2024
1 parent 6096f2d commit 82815bc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions R/cyto_plot-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,8 @@ cyto_plot_new_page <- function(){
#' \code{svg} and \code{pdf} graphics devices.
#' @param res resolution in ppi, set to 300 by default.
#' @param multiple logical indicating whether multiple pages should be saved to
#' separate numbered files, set to \code{TRUE} by default.
#' separate numbered files, set to \code{TRUE} for PDF and \code{FALSE} for
#' other file types by default.
#' @param reset logical indicating whether to reset a previous call to
#' \code{cyto_plot_save}.
#' @param ... additional arguments for the appropriate \code{png()},
Expand Down Expand Up @@ -1369,10 +1370,19 @@ cyto_plot_save <- function(save_as,
height = 7,
units = "in",
res = 300,
multiple = TRUE,
multiple = NULL,
reset = FALSE,
...) {

# DEFAULT MULTIPLE
if(is.null(multiple)) {
if(file_ext(save_as) %in% "pdf") {
multiple <- TRUE
} else {
multiple <- FALSE
}
}

# RESET
if (reset == TRUE) {
# CLOSE DEVICE
Expand Down

0 comments on commit 82815bc

Please sign in to comment.