8000 Use tables for Locator and Formatter docs · matplotlib/matplotlib@3c25a2d · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c25a2d

Browse files
committed
Use tables for Locator and Formatter docs
1 parent 67d04a8 commit 3c25a2d

File tree

1 file changed

+45
-79
lines changed

1 file changed

+45
-79
lines changed

lib/matplotlib/ticker.py

Lines changed: 45 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -18,46 +18,31 @@
1818
`MultipleLocator`. It is initialized with a base, e.g., 10, and it picks
1919
axis limits and ticks that are multiples of that base.
2020
21-
The Locator subclasses defined here are
22-
23-
:class:`AutoLocator`
24-
`MaxNLocator` with simple defaults. This is the default tick locator for
25-
most plotting.
26-
27-
:class:`MaxNLocator`
28-
Finds up to a max number of intervals with ticks at nice locations.
29-
30-
:class:`LinearLocator`
31-
Space ticks evenly from min to max.
32-
33-
:class:`LogLocator`
34-
Space ticks logarithmically from min to max.
35-
36-
:class:`MultipleLocator`
37-
Ticks and range are a multiple of base; either integer or float.
38-
39-
:class:`FixedLocator`
40-
Tick locations are fixed.
41-
42-
:class:`IndexLocator`
43-
Locator for index plots (e.g., where ``x = range(len(y))``).
44-
45-
:class:`NullLocator`
46-
No ticks.
47-
48-
:class:`SymmetricalLogLocator`
49-
Locator for use with with the symlog norm; works like `LogLocator` for the
50-
part outside of the threshold and adds 0 if inside the limits.
51-
52-
:class:`LogitLocator`
53-
Locator for logit scaling.
54-
55-
:class:`AutoMinorLocator`
56-
Locator for minor ticks when the axis is linear and the
57-
major ticks are uniformly spaced. Subdivides the major
58-
tick interval into a specified number of minor intervals,
59-
defaulting to 4 or 5 depending on the major interval.
60-
21+
The Locator subclasses defined here are:
22+
23+
============================== ================================================
24+
:class:`AutoLocator` `MaxNLocator` with simple defaults. This is the
25+
default tick locator for most plotting.
26+
:class:`MaxNLocator` Finds up to a max number of intervals with ticks
27+
at nice locations.
28+
:class:`LinearLocator` Space ticks evenly from min to max.
29+
:class:`LogLocator` Space ticks logarithmically from min to max.
30+
:class:`MultipleLocator` Ticks and range are a multiple of base; either
31+
integer or float.
32+
:class:`FixedLocator` Tick locations are fixed.
33+
:class:`IndexLocator` Locator for index plots (e.g., where
34+
``x = range(len(y))``).
35+
:class:`NullLocator` No ticks.
36+
:class:`SymmetricalLogLocator` Locator for use with with the symlog norm;
37+
works like `LogLocator` for the part outside of
38+
the threshold and adds 0 if inside the limits.
39+
:class:`LogitLocator` Locator for logit scaling.
40+
:class:`AutoMinorLocator` Locator for minor ticks when the axis is linear
41+
and the major ticks are uniformly spaced.
42+
Subdivides the major tick interval into a
43+
specified number of minor intervals, defaulting
44+
to 4 or 5 depending on the major interval.
45+
============================== ================================================
6146
6247
There are a number of locators specialized for date locations - see
6348
the :mod:`.dates` module.
@@ -96,45 +81,26 @@
9681
Tick formatting is controlled by classes derived from Formatter. The formatter
9782
operates on a single tick value and returns a string to the axis.
9883
99-
:class:`NullFormatter`
100-
No labels on the ticks.
101-
102-
:class:`FixedFormatter`
103-
Set the strings manually for the labels.
104-
105-
:class:`FuncFormatter`
106-
User defined function sets the labels.
107-
108-
:class:`StrMethodFormatter`
109-
Use string `format` method.
110-
111-
:class:`FormatStrFormatter`
112-
Use an old-style sprintf format string.
113-
114-
:class:`ScalarFormatter`
115-
Default formatter for scalars: autopick the format string.
116-
117-
:class:`LogFormatter`
118-
Formatter for log axes.
119-
120-
:class:`LogFormatterExponent`
121-
Format values for log axis using ``exponent = log_base(value)``.
122-
123-
:class:`LogFormatterMathtext`
124-
Format values for log axis using ``exponent = log_base(value)``
125-
using Math text.
126-
127-
:class:`LogFormatterSciNotation`
128-
Format values for log axis using scientific notation.
129-
130-
:class:`LogitFormatter`
131-
Probability formatter.
132-
133-
:class:`EngFormatter`
134-
Format labels in engineering notation.
135-
136-
:class:`PercentFormatter`
137-
Format labels as a percentage.
84+
================================ ==============================================
85+
:class:`NullFormatter` No labels on the ticks.
86+
:class:`FixedFormatter` Set the strings manually for the labels.
87+
:class:`FuncFormatter` User defined function sets the labels.
88+
:class:`StrMethodFormatter` Use string `format` method.
89+
:class:`FormatStrFormatter` Use an old-style sprintf format string.
90+
:class:`ScalarFormatter` Default formatter for scalars: autopick the
91+
format string.
92+
:class:`LogFormatter` Formatter for log axes.
93+
:class:`LogFormatterExponent` Format values for log axis using
94+
``exponent = log_base(value)``.
95+
:class:`LogFormatterMathtext` Format values for log axis using
96+
``exponent = log_base(value)`` using
97+
Math text.
98+
:class:`LogFormatterSciNotation` Format values for log axis using scientific
99+
notation.
100+
:class:`LogitFormatter` Probability formatter.
101+
:class:`EngFormatter` Format labels in engineering notation.
102+
:class:`PercentFormatter` Format labels as a percentage.
103+
================================ ==============================================
138104
139105
You can derive your own formatter from the Formatter base class by
140106
simply overriding the ``__call__`` method. The formatter class has

0 commit comments

Comments
 (0)
0