Closed wzel closed 3 years ago
Hi,
I just checked, and it works for me in annotations:
library(ggplot2)
library(latex2exp)
ggplot(data.frame(x = 1:2, y = 1:2),
aes(x = x, y = y)) +
geom_point() +
annotate("text",
x = 1.5, y = 1.5,
label = TeX("a\\phantom{b}c"),
parse = TRUE)
This is what I have as output:
with this warning message:
Warning message:
In is.na(x) : is.na() applied to non-(list or vector) of type 'expression'
I installed the package from your repository using devtools::install_github("wzel/latex2exp")
these are the versions of the libraries installed. [1] latex2exp_0.4.0 ggplot2_3.3.2
Runing R version 4.02, Rstudio/Windows 10
Solution devtools::install_github(repo = "wzel/latex2exp", ref = "add-phantom")
PS: sorry was my mistake! Thanks for that , mate
Glad that you find this useful.
Add \phantom{} support.