Discussion:
[Matplotlib-users] trouble using emoji in labels
Andy Davidson
2016-08-22 03:33:47 UTC
Permalink
I am having a heck of a time figuring out how to use emoji’s in labels. I am
using python3 on a Mac and matplotlib 1.5.2

The unicode demo works.
http://matplotlib.org/examples/pylab_examples/tex_unicode_demo.html I think
my issue might have to do with fonts?


I found a discussion about emojis and fonts at
http://stackoverflow.com/questions/30049760/emoji-in-matplotlib-figures-on-o
s-x
They suggest adding the following line
prop = fm.FontProperties(fname='/System/Library/Fonts&#‌​47;Apple\ Color\
Emoji.ttf')matplotlib.rcParams['font.family'] = prop.get_name()

How ever I get the following error

/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-package
s/matplotlib/font_manager.py in get_name(self)
735 properties.
736 """
--> 737 return ft2font.FT2Font(findfont(self)).family_name
738
739 def get_style(self):

RuntimeError: In FT2Font: Could not set the fantasize

Here is what my graph looks like if I follow the ‘tex unicode demo'
Also I have about 21 different “categories / factors” any suggestions how
to format the graph so the legend looks nice? Notice the colors are reused
and the legend is to bit

Thanks in advance

Andy


Log message:
DEBUG:root:AEDWIP pwsPlotDate() label: ★
DEBUG:root:AEDWIP pwsPlotDate() label: ✅
DEBUG:root:AEDWIP pwsPlotDate() label: ✓
DEBUG:root:AEDWIP pwsPlotDate() label: ✔
DEBUG:root:AEDWIP pwsPlotDate() label: ✪
DEBUG:root:AEDWIP pwsPlotDate() label: ❀
DEBUG:root:AEDWIP pwsPlotDate() label: 🏻
DEBUG:root:AEDWIP pwsPlotDate() label: 🐓
DEBUG:root:AEDWIP pwsPlotDate() label: 🐔
DEBUG:root:AEDWIP pwsPlotDate() label: 🐊
DEBUG:root:AEDWIP pwsPlotDate() label: 👈
DEBUG:root:AEDWIP pwsPlotDate() label: 👍
DEBUG:root:AEDWIP pwsPlotDate() label: 👎
DEBUG:root:AEDWIP pwsPlotDate() label: 👿
DEBUG:root:AEDWIP pwsPlotDate() label: 🔥
DEBUG:root:AEDWIP pwsPlotDate() label: 🖕
DEBUG:root:AEDWIP pwsPlotDate() label: 🗜
DEBUG:root:AEDWIP pwsPlotDate() label: 😂
DEBUG:root:AEDWIP pwsPlotDate() label: 😫
DEBUG:root:AEDWIP pwsPlotDate() label: 🚂

Loading...