I would like to plot Apple emoji in matplotlib, so I wrote this code. However, I get an error that could not set the font size when setting fonts. If I do not set the font it will be plotted like the next image. image of plotting emoji
My system is Mac OS X Sierra 10.12.6, my matplotlib version is 2.0.2.
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
prop = FontProperties(fname='/System/Library/Fonts/Apple Color Emoji.ttc')
plt.rcParams['font.family'] = prop.get_name()
plt.annotate("", (0.5, 0.3), size=30)
plt.annotate("", (0.5, 0.8), size=30)
plt.savefig("emoji_test.png")
File "./emoji_test.py", line 5, in
plt.rcParams['font.family'] = prop.get_name()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/font_manager.py", line 750, in get_name
return get_font(findfont(self)).family_name
RuntimeError: In FT2Font: Could not set the fontsize