From: <md...@us...> - 2008-12-02 20:09:47
|
Revision: 6477 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6477&view=rev Author: mdboom Date: 2008-12-02 20:09:44 +0000 (Tue, 02 Dec 2008) Log Message: ----------- Round theta ticks to the nearest degree, rather than truncating. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/projections/polar.py Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py =================================================================== --- trunk/matplotlib/lib/matplotlib/projections/polar.py 2008-12-02 20:08:53 UTC (rev 6476) +++ trunk/matplotlib/lib/matplotlib/projections/polar.py 2008-12-02 20:09:44 UTC (rev 6477) @@ -137,14 +137,14 @@ 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) + return r"$%0.0f^\circ$" % ((x / npy.pi) * 180.0) else: # we use unicode, rather than mathtext with \circ, 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) - return u"%d\u00b0" % ((x / npy.pi) * 180.0) + return u"%0.0f\u00b0" % ((x / npy.pi) * 180.0) class RadialLocator(Locator): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |