thomasp85 / patchwork

The Composer of ggplots
https://patchwork.data-imaginist.com
Other
2.42k stars 157 forks source link

Missing plot tag in `free()` plots with `theme(plot.tag.position = ...)` #350

Open Fan-iX opened 5 months ago

Fan-iX commented 5 months ago

Plot tags are missing for free() plots when theme(plot.tag.position = ...) is applied.

free(ggplot())+(ggplot()+theme(plot.tag.position = c(0, 0)))+plot_annotation(tag_levels = 'A')

free plot without tagPosition

ggplot()+free(ggplot()+theme(plot.tag.position = c(0, 0)))+plot_annotation(tag_levels = 'A')

free plot with tagPosition

sessionInfo ``` R version 4.2.2 (2022-10-31) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux 11 (bullseye) Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3 LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3 locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] ggplot2_3.4.0 patchwork_1.2.0.9000 loaded via a namespace (and not attached): [1] fansi_1.0.3 withr_2.5.0 dplyr_1.1.0 utf8_1.2.2 [5] grid_4.2.2 R6_2.5.1 lifecycle_1.0.3 gtable_0.3.1 [9] magrittr_2.0.3 scales_1.2.1 pillar_1.8.1 rlang_1.0.6 [13] cli_3.4.1 generics_0.1.3 vctrs_0.5.2 glue_1.6.2 [17] munsell_0.5.0 compiler_4.2.2 pkgconfig_2.0.3 colorspace_2.0-3 [21] tidyselect_1.2.0 tibble_3.1.8 ```