Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6fcb260

Browse files
authored
Merge pull request #16093 from timhoffm/auto-backport-of-pr-16079-on-v3.2.x
Backport PR #16079 on branch v3.2.x (Fix restuctured text formatting)
2 parents 8c62aec + 6ade67c commit 6fcb260

File tree

12 files changed

+46
-38
lines changed

12 files changed

+46
-38
lines changed

doc/users/prev_whats_new/whats_new_3.1.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ show in the legend manually. Now,
9696
handles and labels for a scatter plot in an automated way. This makes
9797
creating a legend for a scatter plot as easy as
9898

99-
.. plot ::
99+
.. plot::
100100

101101
scatter = plt.scatter([1,2,3], [4,5,6], c=[7,2,3])
102102
plt.legend(*scatter.legend_elements())

lib/matplotlib/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,11 +1462,12 @@ def _preprocess_data(func=None, *, replace_names=None, label_namer=None):
14621462
"""
14631463
A decorator to add a 'data' kwarg to a function.
14641464
1465-
::
1465+
When applied::
1466+
14661467
@_preprocess_data()
14671468
def func(ax, *args, **kwargs): ...
14681469
1469-
is a function with signature ``decorated(ax, *args, data=None, **kwargs)``
1470+
the signature is modified to ``decorated(ax, *args, data=None, **kwargs)``
14701471
with the following behavior:
14711472
14721473
- if called with ``data=None``, forward the other arguments to ``func``;

lib/matplotlib/backend_bases.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ class DrawEvent(Event):
12301230
updated. Any extra artists drawn to the canvas's renderer will
12311231
be reflected without an explicit call to ``blit``.
12321232
1233-
.. warning ::
1233+
.. warning::
12341234
12351235
Calling ``canvas.draw`` and ``canvas.blit`` in these callbacks may
12361236
not be safe with all backends and may cause infinite recursion.
@@ -1407,6 +1407,7 @@ class MouseEvent(LocationEvent):
14071407
Examples
14081408
--------
14091409
::
1410+
14101411
def on_press(event):
14111412
print('you pressed', event.button, event.xdata, event.ydata)
14121413
@@ -1504,6 +1505,7 @@ class KeyEvent(LocationEvent):
15041505
Examples
15051506
--------
15061507
::
1508+
15071509
def on_key(event):
15081510
print('you pressed', event.key, event.xdata, event.ydata)
15091511
@@ -2192,6 +2194,7 @@ def func(event: Event) -> Any
21922194
Examples
21932195
--------
21942196
::
2197+
21952198
def on_press(event):
21962199
print('you pressed', event.button, event.xdata, event.ydata)
21972200
@@ -2207,6 +2210,7 @@ def mpl_disconnect(self, cid):
22072210
Examples
22082211
--------
22092212
::
2213+
22102214
cid = canvas.mpl_connect('button_press_event', on_press)
22112215
# ... later
22122216
canvas.mpl_disconnect(cid)

lib/matplotlib/cbook/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,6 +2152,7 @@ class _classproperty:
21522152
Examples
21532153
--------
21542154
::
2155+
21552156
class C:
21562157
@classproperty
21572158
def foo(cls):

lib/matplotlib/cbook/deprecation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ def _rename_parameter(since, old, new, func=None):
269269
Examples
270270
--------
271271
::
272+
272273
@_rename_parameter("3.1", "bad_name", "good_name")
273274
def func(good_name): ...
274275
"""
@@ -326,6 +327,7 @@ def _delete_parameter(since, name, func=None):
326327
Examples
327328
--------
328329
::
330+
329331
@_delete_parameter("3.1", "unused")
330332
def func(used_arg, other_arg, unused, more_args): ...
331333
"""

lib/matplotlib/colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -866,11 +866,11 @@ class ListedColormap(Colormap):
866866
N : int, optional
867867
Number of entries in the map. The default is *None*, in which case
868868
there is one colormap entry for each element in the list of colors.
869-
If::
869+
If ::
870870
871871
N < len(colors)
872872
873-
the list will be truncated at *N*. If::
873+
the list will be truncated at *N*. If ::
874874
875875
N > len(colors)
876876
@@ -948,7 +948,7 @@ def __init__(self, vmin=None, vmax=None, clip=False):
948948
processed. That is, *__call__(A)* calls *autoscale_None(A)*.
949949
If *clip* is *True* and the given value falls outside the range,
950950
the returned value will be 0 or 1, whichever is closer.
951-
Returns 0 if::
951+
Returns 0 if ::
952952
953953
vmin==vmax
954954

lib/matplotlib/contour.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ class ContourSet(cm.ScalarMappable, ContourLabeler):
691691
List of all the polygon segments for all the *levels*.
692692
For contour lines ``len(allsegs) == len(levels)``, and for
693693
filled contour regions ``len(allsegs) = len(levels)-1``. The lists
694-
should look like::
694+
should look like ::
695695
696696
level0segs = [polygon0, polygon1, ...]
697697
polygon0 = [[x0, y0], [x1, y1], ...]
@@ -701,7 +701,7 @@ class ContourSet(cm.ScalarMappable, ContourLabeler):
701701
described and used in Path. This is used to allow multiply-
702702
connected paths such as holes within filled polygons.
703703
If not ``None``, ``len(allkinds) == len(allsegs)``. The lists
704-
should look like::
704+
should look like ::
705705
706706
level0kinds = [polygon0kinds, ...]
707707
polygon0kinds = [vertexcode0, vertexcode1, ...]
@@ -757,7 +757,7 @@ def __init__(self, ax, *args,
757757
List of all the polygon segments for all the *levels*.
758758
For contour lines ``len(allsegs) == len(levels)``, and for
759759
filled contour regions ``len(allsegs) = len(levels)-1``. The lists
760-
should look like::
760+
should look like ::
761761
762762
level0segs = [polygon0, polygon1, ...]
763763
polygon0 = [[x0, y0], [x1, y1], ...]
@@ -767,7 +767,7 @@ def __init__(self, ax, *args,
767767
described and used in Path. This is used to allow multiply-
768768
connected paths such as holes within filled polygons.
769769
If not ``None``, ``len(allkinds) == len(allsegs)``. The lists
770-
should look like::
770+
should look like ::
771771
772772
level0kinds = [polygon0kinds, ...]
773773
polygon0kinds = [vertexcode0, vertexcode1, ...]

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def list_fonts(directory, extensions):
160160
def win32FontDirectory():
161161
r"""
162162
Return the user-specified font directory for Win32. This is
163-
looked up from the registry key::
163+
looked up from the registry key ::
164164
165165
\\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Fonts
166166
@@ -594,7 +594,7 @@ class FontProperties:
594594
absolute font size, e.g., 12
595595
596596
The default font property for TrueType fonts (as specified in the
597-
default rcParams) is::
597+
default rcParams) is ::
598598
599599
sans-serif, normal, normal, normal, normal, scalable.
600600

lib/matplotlib/patches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def set_linestyle(self, ls):
414414
415415
Alternatively a dash tuple of the following form can be provided::
416416
417-
(offset, onoffseq),
417+
(offset, onoffseq)
418418
419419
where ``onoffseq`` is an even length tuple of on and off ink in points.
420420

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ def uninstall_repl_displayhook():
136136
"""
137137
Uninstall the matplotlib display hook.
138138
139-
.. warning
139+
.. warning::
140140
141141
Need IPython >= 2 for this to work. For IPython < 2 will raise a
142142
``NotImplementedError``
143143
144-
.. warning
144+
.. warning::
145145
146146
If you are using vanilla python and have installed another
147147
display hook this will reset ``sys.displayhook`` to what ever

lib/mpl_toolkits/axes_grid1/axes_size.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,8 @@ def get_size(self, renderer):
225225
class Fraction(_Base):
226226
"""
227227
An instance whose size is a *fraction* of the *ref_size*.
228-
::
229228
230-
>>> s = Fraction(0.3, AxesX(ax))
229+
>>> s = Fraction(0.3, AxesX(ax))
231230
232231
"""
233232
def __init__(self, fraction, ref_size):

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def convert_zunits(self, z):
146146
For artists in an axes, if the zaxis has units support,
147147
convert *z* using zaxis unit type
148148
149-
.. versionadded :: 1.2.1
149+
.. versionadded:: 1.2.1
150150
151151
"""
152152
return self.zaxis.convert_units(z)
@@ -333,7 +333,7 @@ def get_autoscale_on(self):
333333
"""
334334
Get whether autoscaling is applied for all axes on plot commands
335335
336-
.. versionadded :: 1.1.0
336+
.. versionadded:: 1.1.0
337337
This function was added, but not tested. Please report any bugs.
338338
"""
339339
return super().get_autoscale_on() and self.get_autoscalez_on()
@@ -342,7 +342,7 @@ def get_autoscalez_on(self):
342342
"""
343343
Get whether autoscaling for the z-axis is applied on plot commands
344344
345-
.. versionadded :: 1.1.0
345+
.. versionadded:: 1.1.0
346346
This function was added, but not tested. Please report any bugs.
347347
"""
348348
return self._autoscaleZon
@@ -351,7 +351,7 @@ def set_autoscale_on(self, b):
351351
"""
352352
Set whether autoscaling is applied on plot commands
353353
354-
.. versionadded :: 1.1.0
354+
.. versionadded:: 1.1.0
355355
This function was added, but not tested. Please report any bugs.
356356
357357
Parameters
@@ -393,7 +393,8 @@ def margins(self, *margins, x=None, y=None, z=None, tight=True):
393393
"""
394394
Convenience method to set or retrieve autoscaling margins.
395395
396-
signatures::
396+
Call signatures::
397+
397398
margins()
398399
399400
returns xmargin, ymargin, zmargin
@@ -508,11 +509,11 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True,
508509
Note that this function applies to the 3D axes, and as such
509510
adds the *scalez* to the function arguments.
510511
511-
.. versionchanged :: 1.1.0
512+
.. versionchanged:: 1.1.0
512513
Function signature was changed to better match the 2D version.
513514
*tight* is now explicitly a kwarg and placed first.
514515
515-
.. versionchanged :: 1.2.1
516+
.. versionchanged:: 1.2.1
516517
This is now fully functional.
517518
518519
"""
@@ -763,7 +764,7 @@ def get_xlim3d(self):
763764
get_xlim = get_xlim3d
764765
if get_xlim.__doc__ is not None:
765766
get_xlim.__doc__ += """
766-
.. versionchanged :: 1.1.0
767+
.. versionchanged:: 1.1.0
767768
This function now correctly refers to the 3D x-limits
768769
"""
769770

@@ -773,7 +774,7 @@ def get_ylim3d(self):
773774
get_ylim = get_ylim3d
774775
if get_ylim.__doc__ is not None:
775776
get_ylim.__doc__ += """
776-
.. versionchanged :: 1.1.0
777+
.. versionchanged:: 1.1.0
777778
This function now correctly refers to the 3D y-limits.
778779
"""
779780

@@ -855,7 +856,7 @@ def get_zmajorticklabels(self):
855856
"""
856857
Get the ztick labels as a list of Text instances
857858
858-
.. versionadded :: 1.1.0
859+
.. versionadded:: 1.1.0
859860
"""
860861
return self.zaxis.get_majorticklabels()
861862

@@ -867,7 +868,7 @@ def get_zminorticklabels(self):
867868
Minor ticks are not supported. This function was added
868869
only for completeness.
869870
870-
.. versionadded :: 1.1.0
871+
.. versionadded:: 1.1.0
871872
"""
872873
return self.zaxis.get_minorticklabels()
873874

@@ -907,7 +908,7 @@ def zaxis_date(self, tz=None):
907908
Axes3D objects do not officially support dates for ticks,
908909
and so this may or may not work as expected.
909910
910-
.. versionadded :: 1.1.0
911+
.. versionadded:: 1.1.0
911912
This function was added, but not tested. Please report any bugs.
912913
"""
913914
self.zaxis.axis_date(tz)
@@ -1212,7 +1213,7 @@ def get_zlabel(self):
12121213
"""
12131214
Get the z-label text string.
12141215
1215-
.. versionadded :: 1.1.0
1216+
.. versionadded:: 1.1.0
12161217
This function was added, but not tested. Please report any bugs.
12171218
"""
12181219
label = self.zaxis.get_label()
@@ -1245,7 +1246,7 @@ def grid(self, b=True, **kwargs):
12451246
:meth:`matplotlib.axes.Axes.grid`, but it is intended to
12461247
eventually support that behavior.
12471248
1248-
.. versionadded :: 1.1.0
1249+
.. versionadded:: 1.1.0
12491250
'''
12501251
# TODO: Operate on each axes separately
12511252
if len(kwargs):
@@ -1264,7 +1265,7 @@ def locator_params(self, axis='both', tight=None, **kwargs):
12641265
can also take a value of 'z' to apply parameters to the
12651266
z axis.
12661267
1267-
.. versionadded :: 1.1.0
1268+
.. versionadded:: 1.1.0
12681269
This function was added, but not tested. Please report any bugs.
12691270
"""
12701271
_x = axis in ['x', 'both']
@@ -1299,7 +1300,7 @@ def tick_params(self, axis='both', **kwargs):
12991300
.. note::
13001301
Axes3D currently ignores some of these settings.
13011302
1302-
.. versionadded :: 1.1.0
1303+
.. versionadded:: 1.1.0
13031304
"""
13041305
cbook._check_in_list(['x', 'y', 'z', 'both'], axis=axis)
13051306
if axis in ['x', 'y', 'both']:
@@ -1318,7 +1319,7 @@ def invert_zaxis(self):
13181319
"""
13191320
Invert the z-axis.
13201321
1321-
.. versionadded :: 1.1.0
1322+
.. versionadded:: 1.1.0
13221323
This function was added, but not tested. Please report any bugs.
13231324
"""
13241325
bottom, top = self.get_zlim()
@@ -1328,7 +1329,7 @@ def zaxis_inverted(self):
13281329
'''
13291330
Returns True if the z-axis is inverted.
13301331
1331-
.. versionadded :: 1.1.0
1332+
.. versionadded:: 1.1.0
13321333
'''
13331334
bottom, top = self.get_zlim()
13341335
return top < bottom
@@ -1337,7 +1338,7 @@ def get_zbound(self):
13371338
"""
13381339
Return the lower and upper z-axis bounds, in increasing order.
13391340
1340-
.. versionadded :: 1.1.0
1341+
.. versionadded:: 1.1.0
13411342
"""
13421343
bottom, top = self.get_zlim()
13431344
if bottom < top:
@@ -1351,7 +1352,7 @@ def set_zbound(self, lower=None, upper=None):
13511352
This method will honor axes inversion regardless of parameter order.
13521353
It will not change the :attr:`_autoscaleZon` attribute.
13531354
1354-
.. versionadded :: 1.1.0
1355+
.. versionadded:: 1.1.0
13551356
"""
13561357
if upper is None and np.iterable(lower):
13571358
lower, upper = lower

0 commit comments

Comments
 (0)