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