Those Computer Modern fonts (specifically the Bakoma distribution of them that matplotlib includes) use a custom character set mapping where many of the characters are in completely arbitrary locations.  For regular text, matplotlib expects a regular Unicode font (particularly to get the minus sign).  Since cmr10 doesn't have a standard encoding, it just won't work. 

You could get around this by overriding the default formatter to use a different symbol for the minus sign.  See this example for an example of overriding the formatter:

http://matplotlib.sourceforge.net/examples/pylab_examples/major_minor_demo1.html#pylab-examples-major-minor-demo1

Mike

On 04/29/2010 03:33 PM, Tony S Yu wrote:
There was a recent thread about the font sizes not matching up between regular text and math text. I decided I'd try to get matching font sizes by using computer modern as the default font, so I added the following to my matplotlibrc file:

font.family: serif
font.serif: cmr10

This fixes the font size issue, but for some reason, MPL's minus sign seems to be using a character not defined by the computer modern fonts (see y-axis in attached image).

Is there a fix for this missing character?

Best,
-Tony

P.S. I'm using the cmr10 fonts provided by MPL (confirmed by using the findfont function).

------------------------------------------------------------------------------
_______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users



------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to