Closed Yiguan closed 1 year ago
Hi,
It looks like a weird issue when there are multiple whitespaces in the labels.
Here is the testing code:
# test data, zz is used as axis text tt <- data.table(xx = 1:5, yy=1:5,zz=c('aa aaa','ddfd fb','fff fb','dddd','fffd')) ggplot(data=tt) + geom_point(aes(x=xx,y=yy)) + scale_y_continuous(breaks=1:5, labels = tt$zz) + theme(axis.text.y = ggtext::element_markdown())
I have some multiple whitespaces in labels. But ggtext::element_markdown() seems only keep one whitespace.
ggtext::element_markdown()
> sessionInfo() R version 4.2.0 (2022-04-22 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19044) ggtext_0.1.2
Thanks in advance!
Yes, HTML collapses whitespace. That's how it works.
Hi,
It looks like a weird issue when there are multiple whitespaces in the labels.
Here is the testing code:
I have some multiple whitespaces in labels. But
ggtext::element_markdown()
seems only keep one whitespace.Thanks in advance!