@@ -267,7 +267,7 @@ class Formatter(TickHelper):
267
267
268
268
def __call__ (self , x , pos = None ):
269
269
"""
270
- Return the format for tick value `x` at position pos.
270
+ Return the format for tick value *x* at position pos.
271
271
``pos=None`` indicates an unspecified location.
272
272
"""
273
273
raise NotImplementedError ('Derived must override' )
@@ -585,14 +585,16 @@ def set_powerlimits(self, lims):
585
585
"""
586
586
Sets size thresholds for scientific notation.
587
587
588
- ``lims`` is a two-element sequence containing the powers of 10
589
- that determine the switchover threshold. Numbers below
590
- ``10**lims[0]`` and above ``10**lims[1]`` will be displayed in
591
- scientific notation.
588
+ Parameters
589
+ ----------
590
+ lims : (min_exp, max_exp)
591
+ A tuple containing the powers of 10 that determine the switchover
592
+ threshold. Numbers below ``10**min_exp`` and above ``10**max_exp``
593
+ will be displayed in scientific notation.
592
594
593
- For example, ``formatter.set_powerlimits((-3, 4))`` sets the
594
- pre-2007 default in which scientific notation is used for
595
- numbers less than 1e-3 or greater than 1e4.
595
+ For example, ``formatter.set_powerlimits((-3, 4))`` sets the
596
+ pre-2007 default in which scientific notation is used for
597
+ numbers less than 1e-3 or greater than 1e4.
596
598
597
599
.. seealso:: Method :meth:`set_scientific`
598
600
"""
@@ -882,7 +884,7 @@ def __init__(self, base=10.0, labelOnlyBase=False,
882
884
883
885
def base (self , base ):
884
886
"""
885
- change the ` base` for labeling.
887
+ Change the * base* for labeling.
886
888
887
889
.. warning::
888
890
Should always match the base used for :class:`LogLocator`
@@ -906,7 +908,7 @@ def set_locs(self, locs=None):
906
908
"""
907
909
Use axis view limits to control which ticks are labeled.
908
910
909
- The `` locs`` parameter is ignored in the present algorithm.
911
+ The * locs* parameter is ignored in the present algorithm.
910
912
911
913
"""
912
914
if np .isinf (self .minor_thresholds [0 ]):
@@ -973,7 +975,7 @@ def _num_to_string(self, x, vmin, vmax):
973
975
974
976
def __call__ (self , x , pos = None ):
975
977
"""
976
- Return the format for tick val `x` .
978
+ Return the format for tick val *x* .
977
979
"""
978
980
if x == 0.0 : # Symlog
979
981
return '0'
@@ -1073,9 +1075,9 @@ def _non_decade_format(self, sign_string, base, fx, usetex):
1073
1075
1074
1076
def __call__ (self , x , pos = None ):
1075
1077
"""
1076
- Return the format for tick value `x` .
1078
+ Return the format for tick value *x* .
1077
1079
1078
- The position ` pos` is ignored.
1080
+ The position * pos* is ignored.
1079
1081
"""
1080
1082
usetex = rcParams ['text.usetex' ]
1081
1083
min_exp = rcParams ['axes.formatter.min_exponent' ]
@@ -1130,7 +1132,7 @@ def __call__(self, x, pos=None):
1130
1132
1131
1133
class LogFormatterSciNotation (LogFormatterMathtext ):
1132
1134
"""
1133
- Format values following scientific notation in a logarithmic axis
1135
+ Format values following scientific notation in a logarithmic axis.
1134
1136
"""
1135
1137
1136
1138
def _non_decade_format (self , sign_string , base , fx , usetex ):
@@ -1303,20 +1305,27 @@ class PercentFormatter(Formatter):
1303
1305
"""
1304
1306
Format numbers as a percentage.
1305
1307
1306
- How the number is converted into a percentage is determined by the
1307
- `xmax` parameter. `xmax` is the data value that corresponds to 100%.
1308
- Percentages are computed as ``x / xmax * 100``. So if the data is
1309
- already scaled to be percentages, `xmax` will be 100. Another common
1310
- situation is where `xmax` is 1.0.
1311
-
1312
- `symbol` is a string which will be appended to the label. It may be
1313
- `None` or empty to indicate that no symbol should be used. LaTeX
1314
- special characters are escaped in `symbol` whenever latex mode is
1315
- enabled, unless `is_latex` is `True`.
1316
-
1317
- `decimals` is the number of decimal places to place after the point.
1318
- If it is set to `None` (the default), the number will be computed
1319
- automatically.
1308
+ Parameters
1309
+ ----------
1310
+ xmax : float
1311
+ Determines how the number is converted into a percentage.
1312
+ *xmax* is the data value that corresponds to 100%.
1313
+ Percentages are computed as ``x / xmax * 100``. So if the data is
1314
+ already scaled to be percentages, *xmax* will be 100. Another common
1315
+ situation is where `xmax` is 1.0.
1316
+
1317
+ decimals : None or int
1318
+ The number of decimal places to place after the point.
1319
+ If *None* (the default), the number will be computed automatically.
1320
+
1321
+ symbol : string or None
1322
+ A string that will be appended to the label. It may be
1323
+ *None* or empty to indicate that no symbol should be used. LaTeX
1324
+ special characters are escaped in *symbol* whenever latex mode is
1325
+ enabled, unless *is_latex* is *True*.
1326
+
1327
+ is_latex : bool
1328
+ If *False*, reserved LaTeX characters in *symbol* will be escaped.
1320
1329
"""
1321
1330
def __init__ (self , xmax = 100 , decimals = None , symbol = '%' , is_latex = False ):
1322
1331
self .xmax = xmax + 0.0
0 commit comments