-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
The following example
library(ggplot2)
library(ragg)
library(Cairo)
set.seed(1)
x = rnorm(1000); y = rnorm(1000)
g = ggplot(data.frame(x, y), aes(x = x, y = y)) +
geom_abline(intercept = 3, slope = 1, size = 3) +
geom_label(x = 2.5, y = -1,
label = "This is italic text\n in Arial Narrow",
family = "Arial Narrow",
fontface = "italic", size = 6, label.size = 0) +
theme_bw(base_family = "Times") +
theme(axis.title = element_text(face = "italic"),
plot.title = element_text( face = "bold"),
plot.subtitle = element_text(face = "italic"),
plot.caption = element_text(face = "plain")) +
geom_point(alpha = 0.4)
Takes around 20 seconds using ragg
res = 300
system.time({
ragg::agg_png("/tmp/tmp-ragg.png", width = 8 * res, height = 6 * res, res = res)
print(g)
dev.off()
})
But only 2 seconds using png
library(extrafont)
extrafont::loadfonts()
system.time({
png("/tmp/tmp-cairo.png", type = "cairo-png", width = 8 * res, height = 6 * res, res = res)
print(g)
dev.off()
})
Your vignette on performance mentions text performance with the comment "Ragg is slightly faster than Cairo", but the associated plot doesn't sure this.
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] extrafont_0.17 Cairo_1.5-11 ragg_0.1.5 ggplot2_3.3.0
loaded via a namespace (and not attached):
[1] clisymbols_1.2.0 tidyselect_1.0.0 xfun_0.12 remotes_2.1.1
[5] memuse_4.1-0 purrr_0.3.3 colorspace_1.4-1 vctrs_0.2.4
[9] htmltools_0.4.0 yaml_2.2.1 rprofile_0.1.2 rlang_0.4.5
[13] startup_0.14.1 gert_0.3 pillar_1.4.3 glue_1.3.2
[17] prettycode_1.1.0 withr_2.1.2 prompt_1.0.0 lifecycle_0.2.0
[21] stringr_1.4.0 munsell_0.5.0 gtable_0.3.0 memoise_1.1.0
[25] evaluate_0.14 knitr_1.28 labeling_0.3 parallel_3.6.3
[29] sys_3.3 fansi_0.4.1 Rttf2pt1_1.3.8 Rcpp_1.0.4
[33] openssl_1.4.1 scales_1.1.0 farver_2.0.3 systemfonts_0.1.1
[37] credentials_1.1 packrat_0.5.0 askpass_1.1 digest_0.6.25
[41] stringi_1.4.6 xaringan_0.16 dplyr_0.8.5 grid_3.6.3
[45] cli_2.0.2 tools_3.6.3 magrittr_1.5 tibble_3.0.0
[49] crayon_1.3.4 extrafontdb_1.0 pkgconfig_2.0.3 ellipsis_0.3.0
[53] assertthat_0.2.1 rmarkdown_2.1 rstudioapi_0.11 R6_2.4.1
[57] compiler_3.6.3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels