Problem getting math symbols into text

It looks like you're configured for the STIX fonts (the rcParam mathtext.fontset = stix), but they are not installed on your system.

Do you have the file "STIXGeneral.ttf" on your system? Perhaps you need to install an additional package.

Mike

···

On 08/04/2010 03:18 PM, Michael Hannon wrote:

Which backend are you using?

Can you set the rcParam "verbose.level" to "debug-annoying" and then
send us the output produced when running a plot? This will include a
number of lines about font lookup that may help us diagnose the problem.
     
Hi, Mike. I'm currently doing this interactively on a Gnome, X-windows desktop.

The default backend for this is evidently:

     TkAgg

I've appended the debug-annoying output, but it may be, as Ben Root has
observed,
that I just need a newer version of matplotlib.

Thanks for your help.

-- Mike

backend TkAgg version 8.5
   

figure()
         

<matplotlib.figure.Figure object at 0x18e6bd0>
   

text(0.5, 0.5, r'\\pi')
         

<matplotlib.text.Text object at 0x1a1dbd0>
   

show()
         

FigureCanvasAgg.draw
RendererAgg.__init__
RendererAgg.__init__ width=650.0, height=490.0
RendererAgg.__init__ _RendererAgg done
RendererAgg.__init__ done
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
findfont: Matching
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
  to DejaVu Sans (/usr/share/fonts/dejavu/DejaVuSans.ttf) with score of 0.100000
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
findfont: Matching
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0
  to DejaVu Sans (/usr/share/fonts/dejavu/DejaVuSans.ttf) with score of 0.100000
findfont: Matching
:family=STIXGeneral:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0
  to STIXGeneral (/usr/share/fonts/stix/STIXGeneral.otf) with score of 0.000000
findfont: Could not match
:family=STIXSize1:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Matching
:family=STIXGeneral:style=normal:variant=normal:weight=bold:stretch=normal:size=12.0
  to STIXGeneral (/usr/share/fonts/stix/STIXGeneralBol.otf) with score of
0.000000
findfont: Could not match
:family=STIXSize3:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=STIXSize4:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=STIXSize5:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=STIXSize2:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Matching
:family=STIXGeneral:style=italic:variant=normal:weight=normal:stretch=normal:size=12.0
  to STIXGeneral (/usr/share/fonts/stix/STIXGeneralItalic.otf) with score of
0.000000
findfont: Could not match
:family=STIXNonUnicode:style=italic:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=STIXNonUnicode:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=STIXNonUnicode:style=normal:variant=normal:weight=bold:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=cmb10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=cmtt10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=cmmi10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=cmex10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=cmsy10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=cmr10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
findfont: Could not match
:family=cmss10:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0.
  Returning /usr/share/fonts/un-core/UnDotum.ttf
RendererAgg.draw_text
RendererAgg.draw_mathtext
   
--
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA

Hi, Mike. I've thrashed around a bit more with this. It appears that if I
use the matplotlib from Fedora 13 (version 0.99) I get the correct behavior
for math text if I also install the stix* packages AND set
rcParams[mathtext.fontset] to "stix". (There are four stix packages in Fedora
13, all small, and I just installed all of them, so I don't know what the
minimum requirement is).

I also got the appropriate math text when I installed the latest matplotlib
from source and used all the default settings. I've now reverted to the
standard Fedora packages and stix, so I can't easily compare the two sets of
rcParams.

Thanks for your help.

-- Mike

···

----- Original Message ----

From: Michael Droettboom <mdroe@...86...>
To: Michael Hannon <jm_hannon@...9...>;
matplotlib-users@lists.sourceforge.net
Sent: Thu, August 5, 2010 6:24:58 AM
Subject: Re: [Matplotlib-users] Problem getting math symbols into text

It looks like you're configured for the STIX fonts (the rcParam
mathtext.fontset = stix), but they are not installed on your system.

Do you have the file "STIXGeneral.ttf" on your system? Perhaps you need to
install an additional package.