Skip to content

Commit 391a164

Browse files
authored
Remove filename from the call to custom devices if file is present in the formals (#4674)
1 parent 13f9e56 commit 391a164

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# ggplot2 (development version)
22

3+
* Better compatibility of custom device functions in `ggsave()`
4+
(@thomasp85, #4539)
5+
36
* Binning scales are now more resilient to calculated limits that ends up being
47
`NaN` after transformations (@thomasp85, #4510)
58

R/save.r

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ plot_dev <- function(device, filename = NULL, dpi = 300) {
162162
call_args <- list()
163163
if ("file" %in% names(args)) {
164164
call_args$file <- filename
165+
call_args["filename"] <- list(NULL)
165166
}
166167
if ("res" %in% names(args)) {
167168
call_args$res <- dpi

0 commit comments

Comments
 (0)