Revision: 4841
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4841&view=rev
Author: mdboom
Date: 2008年01月10日 05:28:01 -0800 (2008年1月10日)
Log Message:
-----------
Fix offset labels (so the times symbol is displayed correctly)
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/ticker.py
Modified: branches/v0_91_maint/lib/matplotlib/ticker.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/ticker.py 2008年01月10日 13:26:35 UTC (rev 4840)
+++ branches/v0_91_maint/lib/matplotlib/ticker.py 2008年01月10日 13:28:01 UTC (rev 4841)
@@ -329,12 +329,16 @@
if self.offset > 0: offsetStr = '+' + offsetStr
if self.orderOfMagnitude:
if self._usetex or self._useMathText:
- sciNotStr = r'{\times}'+self.format_data(10**self.orderOfMagnitude)
+ sciNotStr = self.format_data(10**self.orderOfMagnitude)
else:
- sciNotStr = u'\xd7'+'1e%d'% self.orderOfMagnitude
+ sciNotStr = '1e%d'% self.orderOfMagnitude
if self._useMathText:
- return ''.join(('$\mathdefault{',sciNotStr,offsetStr,'}$'))
+ if sciNotStr != '':
+ sciNotStr = r'\times\mathdefault{%s}' % sciNotStr
+ return ''.join(('$',sciNotStr,r'\mathdefault{',offsetStr,'}$'))
elif self._usetex:
+ if sciNotStr != '':
+ sciNotStr = u'\xd7%s' % sciNotStr
return ''.join(('$',sciNotStr,offsetStr,'$'))
else:
return ''.join((sciNotStr,offsetStr))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.