Created
January 14, 2020 12:52
-
-
Save jeroen/95e56b28461f5fb0feb5a27f686cd241 to your computer and use it in GitHub Desktop.
Benchmark graphics devices for image()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plot_x <- function(x){ | |
x11() | |
image(x) | |
dev.off() | |
} | |
plot_png <- function(x){ | |
png(width = 800, height = 600) | |
image(x) | |
dev.off() | |
} | |
x <- matrix(rnorm(2e6), 1e3) | |
bench::mark( | |
x11 = plot_x(x), | |
png = plot_png(x) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment