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

12 files changed

Lines changed: 46 additions & 38 deletions

File tree

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

0 commit comments

Comments
 (0)