Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d78fb0e

Browse filesBrowse files
authored
Merge pull request #9618 from matplotlib/auto-backport-of-pr-9262
Backport PR #9262 on branch v2.1.x
2 parents 8d7f28b + 0930098 commit d78fb0e
Copy full SHA for d78fb0e

File tree

Expand file treeCollapse file tree

3 files changed

+63
-69
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+63
-69
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+13-15Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3055,28 +3055,27 @@ def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs):
30553055
Parameters
30563056
----------
30573057
labels : list of str
3058-
list of string labels
3058+
List of string labels.
30593059
30603060
fontdict : dict, optional
3061-
A dictionary controlling the appearance of the ticklabels,
3062-
the default `fontdict` is:
3061+
A dictionary controlling the appearance of the ticklabels.
3062+
The default `fontdict` is::
30633063
30643064
{'fontsize': rcParams['axes.titlesize'],
3065-
'fontweight' : rcParams['axes.titleweight'],
3065+
'fontweight': rcParams['axes.titleweight'],
30663066
'verticalalignment': 'baseline',
30673067
'horizontalalignment': loc}
30683068
30693069
minor : bool, optional
3070-
If True select the minor ticklabels,
3071-
else select the major ticklabels
3070+
Whether to set the minor ticklabels rather than the major ones.
30723071
30733072
Returns
30743073
-------
3075-
A list of `~matplotlib.text.Text` instances
3074+
A list of `~.text.Text` instances.
30763075
30773076
Other Parameters
30783077
-----------------
3079-
**kwargs : `~matplotlib.text.Text` properties.
3078+
**kwargs : `~.text.Text` properties.
30803079
"""
30813080
if fontdict is not None:
30823081
kwargs.update(fontdict)
@@ -3373,25 +3372,24 @@ def set_yticklabels(self, labels, fontdict=None, minor=False, **kwargs):
33733372
list of string labels
33743373
33753374
fontdict : dict, optional
3376-
A dictionary controlling the appearance of the ticklabels,
3377-
the default `fontdict` is::
3375+
A dictionary controlling the appearance of the ticklabels.
3376+
The default `fontdict` is::
33783377
33793378
{'fontsize': rcParams['axes.titlesize'],
3380-
'fontweight' : rcParams['axes.titleweight'],
3379+
'fontweight': rcParams['axes.titleweight'],
33813380
'verticalalignment': 'baseline',
33823381
'horizontalalignment': loc}
33833382
33843383
minor : bool, optional
3385-
If True select the minor ticklabels,
3386-
else select the major ticklabels
3384+
Whether to set the minor ticklabels rather than the major ones.
33873385
33883386
Returns
33893387
-------
3390-
A list of `~matplotlib.text.Text` instances.
3388+
A list of `~.text.Text` instances.
33913389
33923390
Other Parameters
33933391
----------------
3394-
**kwargs : `~matplotlib.text.Text` properties.
3392+
**kwargs : `~.text.Text` properties.
33953393
"""
33963394
if fontdict is not None:
33973395
kwargs.update(fontdict)

‎lib/matplotlib/figure.py

Copy file name to clipboardExpand all lines: lib/matplotlib/figure.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ def add_subplot(self, *args, **kwargs):
988988
grid with J rows and K columns.
989989
990990
projection : ['aitoff' | 'hammer' | 'lambert' | \
991-
'mollweide', 'polar' | 'rectilinear'], optional
991+
'mollweide' | 'polar' | 'rectilinear'], optional
992992
The projection type of the axes.
993993
994994
polar : boolean, optional

‎lib/matplotlib/ticker.py

Copy file name to clipboardExpand all lines: lib/matplotlib/ticker.py
+49-53Lines changed: 49 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -37,100 +37,96 @@
3737
3838
The Locator subclasses defined here are
3939
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.
4543
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.
4846
4947
:class:`LinearLocator`
50-
evenly spaced ticks from min to max
48+
Space ticks evenly from min to max.
5149
5250
: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.
5952
6053
: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.
6255
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.
6658
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))``).
6961
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.
7364
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.
7968
8069
:class:`LogitLocator`
8170
Locator for logit scaling.
8271
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+
8382
8483
There are a number of locators specialized for date locations - see
85-
the dates module
84+
the `dates` module.
8685
8786
You can define your own locator by deriving from Locator. You must
8887
override the ``__call__`` method, which returns a sequence of locations,
8988
and you will probably want to override the autoscale method to set the
9089
view limits from the data limits.
9190
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::
9593
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)
10098
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.
103100
104101
Tick formatting
105102
---------------
106103
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.
110106
111107
:class:`NullFormatter`
112-
No labels on the ticks
108+
No labels on the ticks.
113109
114110
:class:`IndexFormatter`
115-
Set the strings from a list of labels
111+
Set the strings from a list of labels.
116112
117113
:class:`FixedFormatter`
118-
Set the strings manually for the labels
114+
Set the strings manually for the labels.
119115
120116
:class:`FuncFormatter`
121-
User defined function sets the labels
117+
User defined function sets the labels.
122118
123119
:class:`StrMethodFormatter`
124-
Use string `format` method
120+
Use string `format` method.
125121
126122
:class:`FormatStrFormatter`
127-
Use an old-style sprintf format string
123+
Use an old-style sprintf format string.
128124
129125
:class:`ScalarFormatter`
130-
Default formatter for scalars: autopick the format string
126+
Default formatter for scalars: autopick the format string.
131127
132128
:class:`LogFormatter`
133-
Formatter for log axes
129+
Formatter for log axes.
134130
135131
:class:`LogFormatterExponent`
136132
Format values for log axis using ``exponent = log_base(value)``.
@@ -158,10 +154,10 @@
158154
To control the major and minor tick label formats, use one of the
159155
following methods::
160156
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)
165161
166162
See :ref:`sphx_glr_gallery_ticks_and_spines_major_minor_demo.py` for an
167163
example of setting major and minor ticks. See the :mod:`matplotlib.dates`

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.