Closed
Description
If there is more than one graphics device open, calling ggsave()
can change which one is active.
For example, in RStudio:
library(ggplot2)
dev.new()
dev.new()
dev.cur()
#> quartz
#> 4
p <- ggplot(mtcars, aes(wt, mpg)) + geom_point()
ggsave('test.png', p)
dev.cur()
#> RStudioGD
#> 2
In R at the terminal:
library(ggplot2)
dev.new()
dev.new()
dev.cur()
#> quartz
#> 3
p <- ggplot(mtcars, aes(wt, mpg)) + geom_point()
ggsave('test.png', p)
dev.cur()
#> quartz
#> 2
Metadata
Metadata
Assignees
Labels
No labels