-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
Hi Thomas,
This is a transfer of tidyverse/ggplot2#6539. Essentially, when trying to render the text 'Sr' and 'Fe', it renders 'Sr' twice instead of each once. In the reprex below, this is why we only see 'Sr' and not 'Fe' on top per the instructions. Other graphics device do not show this problem and so far the only text for which this bug observed is exactly 'Sr' and 'Fe'.
library(grid)
# Render as text grobs
vals <- c("Sr", "Fe")
grobs <- lapply(vals, textGrob)
# Confirm label is correct
grobs[[1]]$label
#> [1] "Sr"
grobs[[2]]$label
#> [1] "Fe"
# Create device for temp file
tmp <- tempfile(fileext = ".png")
ragg::agg_png(tmp)
# Draw the grobs
grid.newpage()
grid.draw(grobs[[1]])
grid.draw(grobs[[2]])
dev.off()
#> png
#> 2
knitr::include_graphics(tmp)Created on 2025-07-02 with reprex v2.1.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
