@@ -259,7 +259,7 @@ class Formatter(TickHelper):
259
259
260
260
def __call__ (self , x , pos = None ):
261
261
"""
262
- Return the format for tick value `x` at position pos.
262
+ Return the format for tick value *x* at position pos.
263
263
``pos=None`` indicates an unspecified location.
264
264
"""
265
265
raise NotImplementedError ('Derived must override' )
@@ -577,14 +577,16 @@ def set_powerlimits(self, lims):
577
577
"""
578
578
Sets size thresholds for scientific notation.
579
579
580
- ``lims`` is a two-element sequence containing the powers of 10
581
- that determine the switchover threshold. Numbers below
582
- ``10**lims[0]`` and above ``10**lims[1]`` will be displayed in
583
- scientific notation.
580
+ Parameters
581
+ ----------
582
+ lims : (min_exp, max_exp)
583
+ A tuple containing the powers of 10 that determine the switchover
584
+ threshold. Numbers below ``10**min_exp`` and above ``10**max_exp``
585
+ will be displayed in scientific notation.
584
586
585
- For example, ``formatter.set_powerlimits((-3, 4))`` sets the
586
- pre-2007 default in which scientific notation is used for
587
- numbers less than 1e-3 or greater than 1e4.
587
+ For example, ``formatter.set_powerlimits((-3, 4))`` sets the
588
+ pre-2007 default in which scientific notation is used for
589
+ numbers less than 1e-3 or greater than 1e4.
588
590
589
591
.. seealso:: Method :meth:`set_scientific`
590
592
"""
@@ -878,7 +880,7 @@ def __init__(self, base=10.0, labelOnlyBase=False,
878
880
879
881
def base (self , base ):
880
882
"""
881
- change the ` base` for labeling.
883
+ Change the * base* for labeling.
882
884
883
885
.. warning::
884
886
Should always match the base used for :class:`LogLocator`
@@ -902,7 +904,7 @@ def set_locs(self, locs=None):
902
904
"""
903
905
Use axis view limits to control which ticks are labeled.
904
906
905
- The `` locs`` parameter is ignored in the present algorithm.
907
+ The * locs* parameter is ignored in the present algorithm.
906
908
907
909
"""
908
910
if np .isinf (self .minor_thresholds [0 ]):
@@ -969,7 +971,7 @@ def _num_to_string(self, x, vmin, vmax):
969
971
970
972
def __call__ (self , x , pos = None ):
971
973
"""
972
- Return the format for tick val `x` .
974
+ Return the format for tick val *x* .
973
975
"""
974
976
if x == 0.0 : # Symlog
975
977
return '0'
@@ -1069,9 +1071,9 @@ def _non_decade_format(self, sign_string, base, fx, usetex):
1069
1071
1070
1072
def __call__ (self , x , pos = None ):
1071
1073
"""
1072
- Return the format for tick value `x` .
1074
+ Return the format for tick value *x* .
1073
1075
1074
- The position ` pos` is ignored.
1076
+ The position * pos* is ignored.
1075
1077
"""
1076
1078
usetex = rcParams ['text.usetex' ]
1077
1079
min_exp = rcParams ['axes.formatter.min_exponent' ]
@@ -1121,7 +1123,7 @@ def __call__(self, x, pos=None):
1121
1123
1122
1124
class LogFormatterSciNotation (LogFormatterMathtext ):
1123
1125
"""
1124
- Format values following scientific notation in a logarithmic axis
1126
+ Format values following scientific notation in a logarithmic axis.
1125
1127
"""
1126
1128
1127
1129
def _non_decade_format (self , sign_string , base , fx , usetex ):
@@ -1282,20 +1284,27 @@ class PercentFormatter(Formatter):
1282
1284
"""
1283
1285
Format numbers as a percentage.
1284
1286
1285
- How the number is converted into a percentage is determined by the
1286
- `xmax` parameter. `xmax` is the data value that corresponds to 100%.
1287
- Percentages are computed as ``x / xmax * 100``. So if the data is
1288
- already scaled to be percentages, `xmax` will be 100. Another common
1289
- situation is where `xmax` is 1.0.
1290
-
1291
- `symbol` is a string which will be appended to the label. It may be
1292
- `None` or empty to indicate that no symbol should be used. LaTeX
1293
- special characters are escaped in `symbol` whenever latex mode is
1294
- enabled, unless `is_latex` is `True`.
1295
-
1296
- `decimals` is the number of decimal places to place after the point.
1297
- If it is set to `None` (the default), the number will be computed
1298
- automatically.
1287
+ Parameters
1288
+ ----------
1289
+ xmax : float
1290
+ Determines how the number is converted into a percentage.
1291
+ *xmax* is the data value that corresponds to 100%.
1292
+ Percentages are computed as ``x / xmax * 100``. So if the data is
1293
+ already scaled to be percentages, *xmax* will be 100. Another common
1294
+ situation is where `xmax` is 1.0.
1295
+
1296
+ decimals : None or int
1297
+ The number of decimal places to place after the point.
1298
+ If *None* (the default), the number will be computed automatically.
1299
+
1300
+ symbol : string or None
1301
+ A string that will be appended to the label. It may be
1302
+ *None* or empty to indicate that no symbol should be used. LaTeX
1303
+ special characters are escaped in *symbol* whenever latex mode is
1304
+ enabled, unless *is_latex* is *True*.
1305
+
1306
+ is_latex : bool
1307
+ If *False*, reserved LaTeX characters in *symbol* will be escaped.
1299
1308
"""
1300
1309
def __init__ (self , xmax = 100 , decimals = None , symbol = '%' , is_latex = False ):
1301
1310
self .xmax = xmax + 0.0
0 commit comments