Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ae31dd

Browse files
committed
fixed a bug in ScalarFormatter
svn path=/trunk/matplotlib/; revision=2668
1 parent f32414d commit 4ae31dd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/matplotlib/ticker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ def __call__(self, x, pos=None):
273273
else:
274274
return self.pprint_val(x)
275275

276+
# TODO: Is it necessary to have two format_data functions?
276277
def format_data_short(self,value):
277278
'return a short formatted string representation of a number'
278279
return '%1.3g'%value
@@ -370,6 +371,7 @@ def _formatSciNotation(self,s, mathtext=False):
370371
mantissa = tup[0].rstrip('0').rstrip('.')
371372
sign = tup[1][0].replace('+', '')
372373
exponent = tup[1][1:].lstrip('0')
374+
if exponent == '': exponent = '0'
373375
if mathtext:
374376
if self._usetex:
375377
if mantissa=='1':

0 commit comments

Comments
 (0)