|
37 | 37 |
|
38 | 38 | The Locator subclasses defined here are
|
39 | 39 |
|
40 |
| -:class:`NullLocator` |
41 |
| - No ticks |
42 |
| -
|
43 |
| -:class:`FixedLocator` |
44 |
| - Tick locations are fixed |
| 40 | +:class:`AutoLocator` |
| 41 | + `MaxNLocator` with simple defaults. This is the default tick locator for |
| 42 | + most plotting. |
45 | 43 |
|
46 |
| -:class:`IndexLocator` |
47 |
| - locator for index plots (e.g., where x = range(len(y))) |
| 44 | +:class:`MaxNLocator` |
| 45 | + Finds up to a max number of intervals with ticks at nice locations. |
48 | 46 |
|
49 | 47 | :class:`LinearLocator`
|
50 |
| - evenly spaced ticks from min to max |
| 48 | + Space ticks evenly from min to max. |
51 | 49 |
|
52 | 50 | :class:`LogLocator`
|
53 |
| - logarithmically ticks from min to max |
54 |
| -
|
55 |
| -:class:`SymmetricalLogLocator` |
56 |
| - locator for use with with the symlog norm, works like the |
57 |
| - `LogLocator` for the part outside of the threshold and add 0 if |
58 |
| - inside the limits |
| 51 | + Space ticks logarithmically from min to max. |
59 | 52 |
|
60 | 53 | :class:`MultipleLocator`
|
61 |
| - ticks and range are a multiple of base; either integer or float |
| 54 | + Ticks and range are a multiple of base; either integer or float. |
62 | 55 |
|
63 |
| -:class:`OldAutoLocator` |
64 |
| - choose a MultipleLocator and dyamically reassign it for |
65 |
| - intelligent ticking during navigation |
| 56 | +:class:`FixedLocator` |
| 57 | + Tick locations are fixed. |
66 | 58 |
|
67 |
| -:class:`MaxNLocator` |
68 |
| - finds up to a max number of ticks at nice locations |
| 59 | +:class:`IndexLocator` |
| 60 | + Locator for index plots (e.g., where ``x = range(len(y))``). |
69 | 61 |
|
70 |
| -:class:`AutoLocator` |
71 |
| - :class:`MaxNLocator` with simple defaults. This is the default |
72 |
| - tick locator for most plotting. |
| 62 | +:class:`NullLocator` |
| 63 | + No ticks. |
73 | 64 |
|
74 |
| -:class:`AutoMinorLocator` |
75 |
| - locator for minor ticks when the axis is linear and the |
76 |
| - major ticks are uniformly spaced. It subdivides the major |
77 |
| - tick interval into a specified number of minor intervals, |
78 |
| - defaulting to 4 or 5 depending on the major interval. |
| 65 | +:class:`SymmetricalLogLocator` |
| 66 | + Locator for use with with the symlog norm; works like `LogLocator` for the |
| 67 | + part outside of the threshold and adds 0 if inside the limits. |
79 | 68 |
|
80 | 69 | :class:`LogitLocator`
|
81 | 70 | Locator for logit scaling.
|
82 | 71 |
|
| 72 | +:class:`OldAutoLocator` |
| 73 | + Choose a `MultipleLocator` and dynamically reassign it for intelligent |
| 74 | + ticking during navigation. |
| 75 | +
|
| 76 | +:class:`AutoMinorLocator` |
| 77 | + Locator for minor ticks when the axis is linear and the |
| 78 | + major ticks are uniformly spaced. Subdivides the major |
| 79 | + tick interval into a specified number of minor intervals, |
| 80 | + defaulting to 4 or 5 depending on the major interval. |
| 81 | +
|
83 | 82 |
|
84 | 83 | There are a number of locators specialized for date locations - see
|
85 |
| -the dates module |
| 84 | +the `dates` module. |
86 | 85 |
|
87 | 86 | You can define your own locator by deriving from Locator. You must
|
88 | 87 | override the ``__call__`` method, which returns a sequence of locations,
|
89 | 88 | and you will probably want to override the autoscale method to set the
|
90 | 89 | view limits from the data limits.
|
91 | 90 |
|
92 |
| -If you want to override the default locator, use one of the above or a |
93 |
| -custom locator and pass it to the x or y axis instance. The relevant |
94 |
| -methods are:: |
| 91 | +If you want to override the default locator, use one of the above or a custom |
| 92 | +locator and pass it to the x or y axis instance. The relevant methods are:: |
95 | 93 |
|
96 |
| - ax.xaxis.set_major_locator( xmajorLocator ) |
97 |
| - ax.xaxis.set_minor_locator( xminorLocator ) |
98 |
| - ax.yaxis.set_major_locator( ymajorLocator ) |
99 |
| - ax.yaxis.set_minor_locator( yminorLocator ) |
| 94 | + ax.xaxis.set_major_locator(xmajor_locator) |
| 95 | + ax.xaxis.set_minor_locator(xminor_locator) |
| 96 | + ax.yaxis.set_major_locator(ymajor_locator) |
| 97 | + ax.yaxis.set_minor_locator(yminor_locator) |
100 | 98 |
|
101 |
| -The default minor locator is the NullLocator, e.g., no minor ticks on by |
102 |
| -default. |
| 99 | +The default minor locator is `NullLocator`, i.e., no minor ticks on by default. |
103 | 100 |
|
104 | 101 | Tick formatting
|
105 | 102 | ---------------
|
106 | 103 |
|
107 |
| -Tick formatting is controlled by classes derived from Formatter. The |
108 |
| -formatter operates on a single tick value and returns a string to the |
109 |
| -axis. |
| 104 | +Tick formatting is controlled by classes derived from Formatter. The formatter |
| 105 | +operates on a single tick value and returns a string to the axis. |
110 | 106 |
|
111 | 107 | :class:`NullFormatter`
|
112 |
| - No labels on the ticks |
| 108 | + No labels on the ticks. |
113 | 109 |
|
114 | 110 | :class:`IndexFormatter`
|
115 |
| - Set the strings from a list of labels |
| 111 | + Set the strings from a list of labels. |
116 | 112 |
|
117 | 113 | :class:`FixedFormatter`
|
118 |
| - Set the strings manually for the labels |
| 114 | + Set the strings manually for the labels. |
119 | 115 |
|
120 | 116 | :class:`FuncFormatter`
|
121 |
| - User defined function sets the labels |
| 117 | + User defined function sets the labels. |
122 | 118 |
|
123 | 119 | :class:`StrMethodFormatter`
|
124 |
| - Use string `format` method |
| 120 | + Use string `format` method. |
125 | 121 |
|
126 | 122 | :class:`FormatStrFormatter`
|
127 |
| - Use an old-style sprintf format string |
| 123 | + Use an old-style sprintf format string. |
128 | 124 |
|
129 | 125 | :class:`ScalarFormatter`
|
130 |
| - Default formatter for scalars: autopick the format string |
| 126 | + Default formatter for scalars: autopick the format string. |
131 | 127 |
|
132 | 128 | :class:`LogFormatter`
|
133 |
| - Formatter for log axes |
| 129 | + Formatter for log axes. |
134 | 130 |
|
135 | 131 | :class:`LogFormatterExponent`
|
136 | 132 | Format values for log axis using ``exponent = log_base(value)``.
|
|
158 | 154 | To control the major and minor tick label formats, use one of the
|
159 | 155 | following methods::
|
160 | 156 |
|
161 |
| - ax.xaxis.set_major_formatter( xmajorFormatter ) |
162 |
| - ax.xaxis.set_minor_formatter( xminorFormatter ) |
163 |
| - ax.yaxis.set_major_formatter( ymajorFormatter ) |
164 |
| - ax.yaxis.set_minor_formatter( yminorFormatter ) |
| 157 | + ax.xaxis.set_major_formatter(xmajor_formatter) |
| 158 | + ax.xaxis.set_minor_formatter(xminor_formatter) |
| 159 | + ax.yaxis.set_major_formatter(ymajor_formatter) |
| 160 | + ax.yaxis.set_minor_formatter(yminor_formatter) |
165 | 161 |
|
166 | 162 | See :ref:`sphx_glr_gallery_ticks_and_spines_major_minor_demo.py` for an
|
167 | 163 | example of setting major and minor ticks. See the :mod:`matplotlib.dates`
|
|
0 commit comments