John Hunter wrote:
> The problem here appears to be in
> matplotlib.projects.polar.ThetaFormatter.__call__, which uses the
> degree symbol.  I think all we need to do is return the proper tex
> string in this case.  Michael, does this look right to you:
>
>         def __call__(self, x, pos=None):
>             # \u00b0 : degree symbol
>             if rcParams['text.usetex'] and not rcParams['text.latex.unicode']:
>                 return r"$%d^\circ$" % ((x / npy.pi) * 180.0)
>             else:
>                 return u"%d\u00b0" % ((x / npy.pi) * 180.0)
>   
Yeah.  Looks good.  Though a "usetex" guy should probably comment as to 
whether "text.latex.unicode == False" is still a good default.

BTW -- the reason I didn't want to use the math syntax in the common 
case is so that it will work correctly with any arbitrary font (assuming 
it has a degree sign), whereas $5\circ$ will only work correctly with 
one of the supported math fonts (Computer Modern and STIX).  For usetex, 
of course, it works fine.

Cheers,
Mike

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to