Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* Data is no longer internally reordered when faceting. This makes it safer to
feed data columns into `aes()` or into parameters of geoms or stats. However,
doing so remains discouraged (@clauswilke).

* `ggsave()` now exits without creating a new graphics device if previously
none was open (@clauswilke, #2363).


# ggplot2 3.0.0
Expand Down
2 changes: 1 addition & 1 deletion R/save.r
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ggsave <- function(filename, plot = last_plot(),
dev(filename = filename, width = dim[1], height = dim[2], ...)
on.exit(utils::capture.output({
grDevices::dev.off()
grDevices::dev.set(old_dev)
if (old_dev > 1) grDevices::dev.set(old_dev) # restore old device unless null device
}))
grid.draw(plot)

Expand Down