@@ -280,7 +280,7 @@ def format_data_short(self, value):
280
280
"""
281
281
Return a short string version of the tick value.
282
282
283
- Defaults to the position-indepedent long value.
283
+ Defaults to the position-independent long value.
284
284
"""
285
285
return self .format_data (value )
286
286
@@ -398,7 +398,7 @@ class FormatStrFormatter(Formatter):
398
398
Use an old-style ('%' operator) format string to format the tick.
399
399
400
400
The format string should have a single variable format (%) in it.
401
- It will be applied to the value (not the postition ) of the tick.
401
+ It will be applied to the value (not the position ) of the tick.
402
402
"""
403
403
def __init__ (self , fmt ):
404
404
self .fmt = fmt
@@ -487,19 +487,16 @@ def pprint_val(self, x, d):
487
487
class ScalarFormatter (Formatter ):
488
488
"""
489
489
Format tick values as a number.
490
+
491
+ Tick value is interpreted as a plain old number. If
492
+ ``useOffset==True`` and the data range is much smaller than the data
493
+ average, then an offset will be determined such that the tick labels
494
+ are meaningful. Scientific notation is used for ``data < 10^-n`` or
495
+ ``data >= 10^m``, where ``n`` and ``m`` are the power limits set
496
+ using ``set_powerlimits((n,m))``. The defaults for these are
497
+ controlled by the ``axes.formatter.limits`` rc parameter.
490
498
"""
491
499
def __init__ (self , useOffset = None , useMathText = None , useLocale = None ):
492
- """
493
- Tick value is interpreted as a plain old number. If
494
- ``useOffset==True`` and the data range is much smaller than the
495
- data average, then an offset will be determined such that the
496
- tick labels are meaningful. Scientific notation is used for
497
- ``data < 10^-n`` or ``data >= 10^m``, where ``n`` and ``m`` are
498
- the power limits set using ``set_powerlimits((n,m))``. The
499
- defaults for these are controlled by the
500
- ``axes.formatter.limits`` rc parameter.
501
- """
502
-
503
500
# useOffset allows plotting small data ranges with large offsets: for
504
501
# example: [1+1e-9,1+2e-9,1+3e-9] useMathText will render the offset
505
502
# and scientific notation in mathtext
@@ -553,7 +550,9 @@ def fix_minus(self, s):
553
550
return s .replace ('-' , '\u2212 ' )
554
551
555
552
def __call__ (self , x , pos = None ):
556
- 'Return the format for tick val *x* at position *pos*'
553
+ """
554
+ Return the format for tick value `x` at position `pos`.
555
+ """
557
556
if len (self .locs ) == 0 :
558
557
return ''
559
558
else :
@@ -572,7 +571,7 @@ def set_powerlimits(self, lims):
572
571
"""
573
572
Sets size thresholds for scientific notation.
574
573
575
- Limits is a two-element sequence containing the powers of 10
574
+ ``lims`` is a two-element sequence containing the powers of 10
576
575
that determine the switchover threshold. Numbers below
577
576
``10**lims[0]`` and above ``10**lims[1]`` will be displayed in
578
577
scientific notation.
0 commit comments