@@ -143,7 +143,7 @@ class Formatter(TickHelper):
143
143
144
144
# some classes want to see all the locs to help format
145
145
# individual ones
146
- locs = None
146
+ locs = []
147
147
def __call__ (self , x , pos = 0 ):
148
148
'Return the format for tick val x at position pos'
149
149
raise NotImplementedError ('Derived must overide' )
@@ -201,7 +201,7 @@ def __call__(self, x, pos=0):
201
201
return self .fmt % x
202
202
203
203
204
- class _ScalarFormatter (Formatter ):
204
+ class OldScalarFormatter (Formatter ):
205
205
"""
206
206
Tick location is a plain old number. If viewInterval is set, the
207
207
formatter will use %d, %1.#f or %1.ef as appropriate. If it is
@@ -260,7 +260,7 @@ def __init__(self, useOffset=True, useMathText=False):
260
260
261
261
def __call__ (self , x , pos = 0 ):
262
262
'Return the format for tick val x at position pos'
263
- if self .locs == None :
263
+ if len ( self .locs ) == 0 :
264
264
return ''
265
265
else :
266
266
return self .pprint_val (x )
@@ -272,7 +272,7 @@ def format_data(self,value):
272
272
273
273
def get_offset (self ):
274
274
"""Return scientific notation, plus offset"""
275
- if self .locs == None : return ''
275
+ if len ( self .locs ) == 0 : return ''
276
276
if self .orderOfMagnitude or self .offset :
277
277
offsetStr = ''
278
278
sciNotStr = ''
@@ -289,7 +289,7 @@ def get_offset(self):
289
289
def set_locs (self , locs ):
290
290
'set the locations of the ticks'
291
291
self .locs = locs
292
- if self .locs != None :
292
+ if len ( self .locs ) > 0 :
293
293
self .verify_intervals ()
294
294
d = abs (self .viewInterval .span ())
295
295
if self ._useOffset : self ._set_offset (d )
0 commit comments