<div dir="ltr">I am having trouble reproducing this, you might want to raise this issue with the Fedora folks as they do some funny stuff with fonts + packaging mpl.<div><br></div><div>Tom</div><div><br></div>PS this list has moved to <a href="mailto:matplotlib-users@python.org">matplotlib-users@python.org</a><div><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 6, 2015 at 8:43 AM Neal Becker <<a href="mailto:ndbecker2@gmail.com">ndbecker2@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Neal Becker wrote:<br>
<br>
> Using mpl 1.4.3 on Fedora 22, I'm trying to use stix font (so I can render<br>
> the unicode lambda label on the x-axis).  I have every fedora package<br>
> related to 'stix', I think. It displays ok in qtagg4, but if I try to save<br>
> to pdf if fails with<br>
><br>
> RuntimeError                              Traceback (most recent call<br>
> last) <ipython-input-2-7dee58c07264> in <module>()<br>
> ----> 1 exec(open(r'/usr/tmp/python-8710q1Y.py').read()) # PYTHON-MODE<br>
><br>
> <string> in <module>()<br>
><br>
> /usr/lib64/python3.4/site-packages/matplotlib/pyplot.py in savefig(*args,<br>
> **kwargs)<br>
>     575 def savefig(*args, **kwargs):<br>
>     576     fig = gcf()<br>
> --> 577     res = fig.savefig(*args, **kwargs)<br>
>     578     draw()   # need this if 'transparent=True' to reset colors<br>
>     579     return res<br>
><br>
> /usr/lib64/python3.4/site-packages/matplotlib/figure.py in savefig(self,<br>
> *args, **kwargs)<br>
>    1474             self.set_frameon(frameon)<br>
>    1475<br>
> -> 1476         self.canvas.print_figure(*args, **kwargs)<br>
>    1477<br>
>    1478         if frameon:<br>
><br>
> /usr/lib64/python3.4/site-packages/matplotlib/backend_bases.py in<br>
> print_figure(self, filename, dpi, facecolor, edgecolor, orientation,<br>
> format, **kwargs)<br>
>    2209                 orientation=orientation,<br>
>    2210                 bbox_inches_restore=_bbox_inches_restore,<br>
> -> 2211                 **kwargs)<br>
>    2212         finally:<br>
>    2213             if bbox_inches and restore_bbox:<br>
><br>
> /usr/lib64/python3.4/site-packages/matplotlib/backends/backend_pdf.py in<br>
> print_pdf(self, filename, **kwargs)<br>
>    2489                 file.endStream()<br>
>    2490             else:            # we opened the file above; now<br>
>    finish<br>
> it off<br>
> -> 2491                 file.close()<br>
>    2492<br>
>    2493<br>
><br>
> /usr/lib64/python3.4/site-packages/matplotlib/backends/backend_pdf.py in<br>
> close(self)<br>
>     523         self.endStream()<br>
>     524         # Write out the various deferred objects<br>
> --> 525         self.writeFonts()<br>
>     526         self.writeObject(self.alphaStateObject,<br>
>     527                          dict([(val[0], val[1])<br>
><br>
> /usr/lib64/python3.4/site-packages/matplotlib/backends/backend_pdf.py in<br>
> writeFonts(self)<br>
>     626                 chars = self.used_characters.get(stat_key)<br>
>     627                 if chars is not None and len(chars[1]):<br>
> --> 628                     fonts[Fx] = self.embedTTF(realpath, chars[1])<br>
>     629         self.writeObject(self.fontObject, fonts)<br>
>     630<br>
><br>
> /usr/lib64/python3.4/site-packages/matplotlib/backends/backend_pdf.py in<br>
> embedTTF(self, filename, characters)<br>
>    1101<br>
>    1102         if fonttype == 3:<br>
> -> 1103             return embedTTFType3(font, characters, descriptor)<br>
>    1104         elif fonttype == 42:<br>
>    1105             return embedTTFType42(font, characters, descriptor)<br>
><br>
> /usr/lib64/python3.4/site-packages/matplotlib/backends/backend_pdf.py in<br>
> embedTTFType3(font, characters, descriptor)<br>
>     887             # actual outlines)<br>
>     888             rawcharprocs = ttconv.get_pdf_charprocs(<br>
> --> 889                 filename.encode(sys.getfilesystemencoding()),<br>
> glyph_ids)<br>
>     890             charprocs = {}<br>
>     891             for charname, stream in six.iteritems(rawcharprocs):<br>
><br>
> RuntimeError: TrueType font is missing table<br>
><br>
<br>
forgot to attach the code.<br>
<br>
<br>
#!/usr/bin/python<br>
# -*- coding: utf-8 -*-<br>
data='''carriers,lambda,per<br>
1,7,1.3e-4<br>
1,8,3.0e-4<br>
1,9,.0014<br>
8,7,4.8e-4<br>
8,8,1.3e-3<br>
8,9,.0075<br>
'''<br>
<br>
import pandas as pd<br>
try:<br>
    from StringIO import StringIO<br>
except ImportError:<br>
    from io import StringIO<br>
df = pd.read_csv (StringIO (data))<br>
g = df.groupby ('carriers')<br>
import matplotlib.pyplot as plt<br>
<br>
import matplotlib as mpl<br>
#mpl.rcParams['font.family'] = 'stix'<br>
mpl.rc('font', family='DejaVu Sans')<br>
#mpl.rc('font', family='stix')<br>
<br>
import itertools<br>
markers = itertools.cycle(['o','s','v'])<br>
<br>
fig = plt.figure()<br>
ax = fig.add_subplot(111)<br>
for c, stuff in g:<br>
    plt.semilogy (stuff['lambda'].values, stuff['per'].values,<br>
label='carriers=%s'%c, marker=next(markers))<br>
<br>
plt.legend (loc='best')<br>
ax.set_xlabel (' ')<br>
ax.set_ylabel ('per')<br>
plt.grid(which='major', linestyle='solid')<br>
plt.grid(which='minor', linestyle='dashed')<br>
plt.savefig ('per_vs_lambda.pdf')<br>
<br>
<br>
<br>
<br>
<br>
<br>
------------------------------------------------------------------------------<br>
Don't Limit Your Business. Reach for the Cloud.<br>
GigeNET's Cloud Solutions provide you with the tools and support that<br>
you need to offload your IT needs and focus on growing your business.<br>
Configured For All Businesses. Start Your Cloud Today.<br>
<a href="https://www.gigenetcloud.com/" rel="noreferrer" target="_blank">https://www.gigenetcloud.com/</a><br>
_______________________________________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@lists.sourceforge.net" target="_blank">Matplotlib-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/matplotlib-users</a><br>
</blockquote></div></div></div>