Cannot use ten thousand unicode character as axis label

I would like to add a ten thousand symbol to the axis label using ggplot2 .

To insert a thousand symbol, I can use:

 library(ggplot2) qplot(1, 1) + ylab("\u2030") 

But when I use

 qplot(1, 1) + ylab("\u2031") 

to generate a ten thousand symbol, the result generated is a field containing a question mark. The text family uses Calibri, but the same output is generated with the default text family.

Is this character supported?

+1
source share
1 answer

You need to use a font that supports this character. From this list, I tried Arial Unicode MS :

 windowsFonts( A=windowsFont("Arial Unicode MS") ) plot(1) text(1, 1.2,"\u2031", family = "A") 

final schedule

Consult this tutorial for changing fonts in ggplot2.

+2
source

Source: https://habr.com/ru/post/1242377/


All Articles