Closed aphalo closed 1 year ago
Do you have any workaround in mind for this issue? I observe the same (for spaces and +
) when exporting as a png with ggsave()
:
It doesn't show up in the R graphics window, just on the exported file. Actually I remember I once got the issue and found another way to export my plot to a file than ggsave()
, and it solved the issue, but I cannot find the script where I did that and don't remember at all which command I used.
If that helps troubleshooting, but I understand this is likely an issue external to ggpmisc
, exporting to PDF instead of PNG with ggsave(…, device = cairo_pdf)
solves the issue:
[Edit] Well, exporting to PNG works too, you just have to specify the device with ggsave(…, device = png)
. I find it weird that this doesn't automatically picks that device when using the .png
extension, but hey.
@mlaparie In R there are multiple graphic devices for the same type of file output. From package 'ragg' there is agg_png
, there is from package 'Cairo', Cairo_png
and from R's 'grDevices' built-in package, png
. The different devices have different limitations, and most likely ggsave()
by default is using a different png device than png
. RStudio in the latest versions, I think, uses the 'ragg' devices by default as they are faster. You could test if you get good or bad output with ggsave(..., device = ragg::agg_png)
.
TODO: test thoroughly and add suggested workarounds or good 'ggtext' versions.
Seems to now work correctly.
I suspect this is a problem in 'ggtext' rather than 'ggpmisc', but anyway spurious space is inserted where there is not any in
eq.label
.