I am plotting statistics related to different translations of a word. Using python / matplotlib under Ubuntu I cannot get my legend to show all my languages.
My code below
#!/usr/bin/python
import matplotlib.pyplot as plt
import matplotlib
matplotlib.use('pgf') # This may make things harder; solutions without it are still of interest
# pip3 install matplotlib==3.5
plt.close('all')
fig,ax= plt.subplots(1)
ax.plot(1,1,'.',label='english')
ax.plot(1,2,'.',label='Glück')
ax.plot(1,1,'.',label='доход')
ax.plot(1,1,'.',label='幸福')
plt.legend()
plt.savefig('tmp.pdf')
plt.savefig('tmp.png')
print(matplotlib.__version__)
seems to do fine with various Unicode, but not Chinese. I get the following:
/home/meuser/tmpbug.py:23: UserWarning: Glyph 24184 (\N{CJK UNIFIED IDEOGRAPH-5E78}) missing from current font.
/home/meuser/tmpbug.py:23: UserWarning: Glyph 31119 (\N{CJK UNIFIED IDEOGRAPH-798F}) missing from current font.
/home/meuser/tmpbug.py:23: UserWarning: Glyph 24184 (\N{CJK UNIFIED IDEOGRAPH-5E78}) missing from current font.
/home/meuser/tmpbug.py:23: UserWarning: Glyph 31119 (\N{CJK UNIFIED IDEOGRAPH-798F}) missing from current font.
/home/meuser/tmpbug.py:24: UserWarning: Glyph 24184 (\N{CJK UNIFIED IDEOGRAPH-5E78}) missing from current font.
print(plt.__version__)
/home/meuser/tmpbug.py:24: UserWarning: Glyph 31119 (\N{CJK UNIFIED IDEOGRAPH-798F}) missing from current font.
print(plt.__version__)
3.5.0
How can I get all my labels to show in one legend? If this is not possible, why not?


