1

I want to have with subscript 'x' (normal R font). It doesn't need to be using the font_add_google function, any solution is appreciated. Thanks! The unicode is U1D505 if this might be helpful.

font_add_google(name = 'UnifrakturMaguntia','fraktur')
showtext_auto()
df <- data.frame()
ggplot(df) + 
  geom_point() + 
  xlim(0, 10) + 
  ylim(0, 100) + 
  ylab(bquote(B[x])) + 
  theme(axis.title.y = element_text(family = "fraktur", size = 20),
        title = element_text(family="sans"))
showtext_auto(FALSE)

I tried what I wrote above.

stefan
  • 90,330
  • 6
  • 25
  • 51
JR96
  • 11
  • 2
  • Have you tried `ylab(bquote("\U1D505"[x]))`? – stefan Jun 22 '23 at 15:03
  • Yes, this doesn't work. Just plots an empty box. – JR96 Jun 22 '23 at 15:18
  • Hm. Probably one of these annoying font or device issues. On my Mac I get empty boxes too when I use the default graphics device. But it works fine when I use `Cairo` or r`AGG`: https://i.stack.imgur.com/yLpky.png. – stefan Jun 22 '23 at 16:17

0 Answers0