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

Skip to content

Commit 9add352

Browse files
authored
Merge pull request #16079 from timhoffm/fix-ReST
Fix restuctured text formatting
2 parents 3841267 + b4d3468 commit 9add352

13 files changed

Lines changed: 47 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
@@ -1345,11 +1345,12 @@ def _preprocess_data(func=None, *, replace_names=None, label_namer=None):
13451345
"""
13461346
A decorator to add a 'data' kwarg to a function.
13471347
1348-
::
1348+
When applied::
1349+
13491350
@_preprocess_data()
13501351
def func(ax, *args, **kwargs): ...
13511352
1352-
is a function with signature ``decorated(ax, *args, data=None, **kwargs)``
1353+
the signature is modified to ``decorated(ax, *args, data=None, **kwargs)``
13531354
with the following behavior:
13541355
13551356
- 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
@@ -1210,7 +1210,7 @@ class DrawEvent(Event):
12101210
updated. Any extra artists drawn to the canvas's renderer will
12111211
be reflected without an explicit call to ``blit``.
12121212
1213-
.. warning ::
1213+
.. warning::
12141214
12151215
Calling ``canvas.draw`` and ``canvas.blit`` in these callbacks may
12161216
not be safe with all backends and may cause infinite recursion.
@@ -1385,6 +1385,7 @@ class MouseEvent(LocationEvent):
13851385
Examples
13861386
--------
13871387
::
1388+
13881389
def on_press(event):
13891390
print('you pressed', event.button, event.xdata, event.ydata)
13901391
@@ -1481,6 +1482,7 @@ class KeyEvent(LocationEvent):
14811482
Examples
14821483
--------
14831484
::
1485+
14841486
def on_key(event):
14851487
print('you pressed', event.key, event.xdata, event.ydata)
14861488
@@ -2195,6 +2197,7 @@ def func(event: Event) -> Any
21952197
Examples
21962198
--------
21972199
::
2200+
21982201
def on_press(event):
21992202
print('you pressed', event.button, event.xdata, event.ydata)
22002203
@@ -2210,6 +2213,7 @@ def mpl_disconnect(self, cid):
22102213
Examples
22112214
--------
22122215
::
2216+
22132217
cid = canvas.mpl_connect('button_press_event', on_press)
22142218
# ... later
22152219
canvas.mpl_disconnect(cid)

lib/matplotlib/cbook/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,6 +2193,7 @@ class _classproperty:
21932193
Examples
21942194
--------
21952195
::
2196+
21962197
class C:
21972198
@classproperty
21982199
def foo(cls):

lib/matplotlib/cbook/deprecation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ def _rename_parameter(since, old, new, func=None):
268268
Examples
269269
--------
270270
::
271+
271272
@_rename_parameter("3.1", "bad_name", "good_name")
272273
def func(good_name): ...
273274
"""
@@ -325,6 +326,7 @@ def _delete_parameter(since, name, func=None):
325326
Examples
326327
--------
327328
::
329+
328330
@_delete_parameter("3.1", "unused")
329331
def func(used_arg, other_arg, unused, more_args): ...
330332
"""

lib/matplotlib/colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,11 +851,11 @@ class ListedColormap(Colormap):
851851
N : int, optional
852852
Number of entries in the map. The default is *None*, in which case
853853
there is one colormap entry for each element in the list of colors.
854-
If::
854+
If ::
855855
856856
N < len(colors)
857857
858-
the list will be truncated at *N*. If::
858+
the list will be truncated at *N*. If ::
859859
860860
N > len(colors)
861861
@@ -933,7 +933,7 @@ def __init__(self, vmin=None, vmax=None, clip=False):
933933
processed. That is, *__call__(A)* calls *autoscale_None(A)*.
934934
If *clip* is *True* and the given value falls outside the range,
935935
the returned value will be 0 or 1, whichever is closer.
936-
Returns 0 if::
936+
Returns 0 if ::
937937
938938
vmin==vmax
939939

lib/matplotlib/contour.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ class ContourSet(cm.ScalarMappable, ContourLabeler):
688688
List of all the polygon segments for all the *levels*.
689689
For contour lines ``len(allsegs) == len(levels)``, and for
690690
filled contour regions ``len(allsegs) = len(levels)-1``. The lists
691-
should look like::
691+
should look like ::
692692
693693
level0segs = [polygon0, polygon1, ...]
694694
polygon0 = [[x0, y0], [x1, y1], ...]
@@ -698,7 +698,7 @@ class ContourSet(cm.ScalarMappable, ContourLabeler):
698698
described and used in Path. This is used to allow multiply-
699699
connected paths such as holes within filled polygons.
700700
If not ``None``, ``len(allkinds) == len(allsegs)``. The lists
701-
should look like::
701+
should look like ::
702702
703703
level0kinds = [polygon0kinds, ...]
704704
polygon0kinds = [vertexcode0, vertexcode1, ...]
@@ -754,7 +754,7 @@ def __init__(self, ax, *args,
754754
List of all the polygon segments for all the *levels*.
755755
For contour lines ``len(allsegs) == len(levels)``, and for
756756
filled contour regions ``len(allsegs) = len(levels)-1``. The lists
757-
should look like::
757+
should look like ::
758758
759759
level0segs = [polygon0, polygon1, ...]
760760
polygon0 = [[x0, y0], [x1, y1], ...]
@@ -764,7 +764,7 @@ def __init__(self, ax, *args,
764764
described and used in Path. This is used to allow multiply-
765765
connected paths such as holes within filled polygons.
766766
If not ``None``, ``len(allkinds) == len(allsegs)``. The lists
767-
should look like::
767+
should look like ::
768768
769769
level0kinds = [polygon0kinds, ...]
770770
polygon0kinds = [vertexcode0, vertexcode1, ...]

lib/matplotlib/dviread.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ class Vf(Dvi):
587587
Examples
588588
--------
589589
::
590+
590591
vf = Vf(filename)
591592
glyph = vf[code]
592593
glyph.text, glyph.boxes, glyph.width

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

0 commit comments

Comments
 (0)