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

Skip to content

Commit b4d3468

Browse files
committed
Fix restuctured text formatting
1 parent aef04ab commit b4d3468

File tree

13 files changed

+47
-38
lines changed

13 files changed

+47
-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
@@ -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
@@ -1211,7 +1211,7 @@ class DrawEvent(Event):
12111211
updated. Any extra artists drawn to the canvas's renderer will
12121212
be reflected without an explicit call to ``blit``.
12131213
1214-
.. warning ::
1214+
.. warning::
12151215
12161216
Calling ``canvas.draw`` and ``canvas.blit`` in these callbacks may
12171217
not be safe with all backends and may cause infinite recursion.
@@ -1386,6 +1386,7 @@ class MouseEvent(LocationEvent):
13861386
Examples
13871387
--------
13881388
::
1389+
13891390
def on_press(event):
13901391
print('you pressed', event.button, event.xdata, event.ydata)
13911392
@@ -1482,6 +1483,7 @@ class KeyEvent(LocationEvent):
14821483
Examples
14831484
--------
14841485
::
1486+
14851487
def on_key(event):
14861488
print('you pressed', event.key, event.xdata, event.ydata)
14871489
@@ -2194,6 +2196,7 @@ def func(event: Event) -> Any
21942196
Examples
21952197
--------
21962198
::
2199+
21972200
def on_press(event):
21982201
print('you pressed', event.button, event.xdata, event.ydata)
21992202
@@ -2209,6 +2212,7 @@ def mpl_disconnect(self, cid):
22092212
Examples
22102213
--------
22112214
::
2215+
22122216
cid = canvas.mpl_connect('button_press_event', on_press)
22132217
# ... later
22142218
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

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ def uninstall_repl_displayhook():
134134
"""
135135
Uninstall the matplotlib display hook.
136136
137-
.. warning
137+
.. warning::
138138
139139
Need IPython >= 2 for this to work. For IPython < 2 will raise a
140140
``NotImplementedError``
141141
142-
.. warning
142+
.. warning::
143143
144144
If you are using vanilla python and have installed another
145145
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
@@ -218,9 +218,8 @@ def get_size(self, renderer):
218218
class Fraction(_Base):
219219
"""
220220
An instance whose size is a *fraction* of the *ref_size*.
221-
::
222221
223-
>>> s = Fraction(0.3, AxesX(ax))
222+
>>> s = Fraction(0.3, AxesX(ax))
224223
225224
"""
226225
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
@@ -143,7 +143,7 @@ def convert_zunits(self, z):
143143
For artists in an axes, if the zaxis has units support,
144144
convert *z* using zaxis unit type
145145
146-
.. versionadded :: 1.2.1
146+
.. versionadded:: 1.2.1
147147
148148
"""
149149
return self.zaxis.convert_units(z)
@@ -330,7 +330,7 @@ def get_autoscale_on(self):
330330
"""
331331
Get whether autoscaling is applied for all axes on plot commands
332332
333-
.. versionadded :: 1.1.0
333+
.. versionadded:: 1.1.0
334334
This function was added, but not tested. Please report any bugs.
335335
"""
336336
return super().get_autoscale_on() and self.get_autoscalez_on()
@@ -339,7 +339,7 @@ def get_autoscalez_on(self):
339339
"""
340340
Get whether autoscaling for the z-axis is applied on plot commands
341341
342-
.. versionadded :: 1.1.0
342+
.. versionadded:: 1.1.0
343343
This function was added, but not tested. Please report any bugs.
344344
"""
345345
return self._autoscaleZon
@@ -348,7 +348,7 @@ def set_autoscale_on(self, b):
348348
"""
349349
Set whether autoscaling is applied on plot commands
350350
351-
.. versionadded :: 1.1.0
351+
.. versionadded:: 1.1.0
352352
This function was added, but not tested. Please report any bugs.
353353
354354
Parameters
@@ -390,7 +390,8 @@ def margins(self, *margins, x=None, y=None, z=None, tight=True):
390390
"""
391391
Convenience method to set or retrieve autoscaling margins.
392392
393-
signatures::
393+
Call signatures::
394+
394395
margins()
395396
396397
returns xmargin, ymargin, zmargin
@@ -505,11 +506,11 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True,
505506
Note that this function applies to the 3D axes, and as such
506507
adds the *scalez* to the function arguments.
507508
508-
.. versionchanged :: 1.1.0
509+
.. versionchanged:: 1.1.0
509510
Function signature was changed to better match the 2D version.
510511
*tight* is now explicitly a kwarg and placed first.
511512
512-
.. versionchanged :: 1.2.1
513+
.. versionchanged:: 1.2.1
513514
This is now fully functional.
514515
"""
515516
# This method looks at the rectangular volume (see above)
@@ -737,7 +738,7 @@ def get_xlim3d(self):
737738
get_xlim3d.__doc__ = maxes.Axes.get_xlim.__doc__
738739
if get_xlim3d.__doc__ is not None:
739740
get_xlim3d.__doc__ += """
740-
.. versionchanged :: 1.1.0
741+
.. versionchanged:: 1.1.0
741742
This function now correctly refers to the 3D x-limits
742743
"""
743744

@@ -746,7 +747,7 @@ def get_ylim3d(self):
746747
get_ylim3d.__doc__ = maxes.Axes.get_ylim.__doc__
747748
if get_ylim3d.__doc__ is not None:
748749
get_ylim3d.__doc__ += """
749-
.. versionchanged :: 1.1.0
750+
.. versionchanged:: 1.1.0
750751
This function now correctly refers to the 3D y-limits.
751752
"""
752753

@@ -827,7 +828,7 @@ def get_zmajorticklabels(self):
827828
"""
828829
Get the ztick labels as a list of Text instances
829830
830-
.. versionadded :: 1.1.0
831+
.. versionadded:: 1.1.0
831832
"""
832833
return self.zaxis.get_majorticklabels()
833834

@@ -839,7 +840,7 @@ def get_zminorticklabels(self):
839840
Minor ticks are not supported. This function was added
840841
only for completeness.
841842
842-
.. versionadded :: 1.1.0
843+
.. versionadded:: 1.1.0
843844
"""
844845
return self.zaxis.get_minorticklabels()
845846

@@ -879,7 +880,7 @@ def zaxis_date(self, tz=None):
879880
Axes3D objects do not officially support dates for ticks,
880881
and so this may or may not work as expected.
881882
882-
.. versionadded :: 1.1.0
883+
.. versionadded:: 1.1.0
883884
This function was added, but not tested. Please report any bugs.
884885
"""
885886
self.zaxis.axis_date(tz)
@@ -1200,7 +1201,7 @@ def get_zlabel(self):
12001201
"""
12011202
Get the z-label text string.
12021203
1203-
.. versionadded :: 1.1.0
1204+
.. versionadded:: 1.1.0
12041205
This function was added, but not tested. Please report any bugs.
12051206
"""
12061207
label = self.zaxis.get_label()
@@ -1233,7 +1234,7 @@ def grid(self, b=True, **kwargs):
12331234
:meth:`matplotlib.axes.Axes.grid`, but it is intended to
12341235
eventually support that behavior.
12351236
1236-
.. versionadded :: 1.1.0
1237+
.. versionadded:: 1.1.0
12371238
"""
12381239
# TODO: Operate on each axes separately
12391240
if len(kwargs):
@@ -1252,7 +1253,7 @@ def locator_params(self, axis='both', tight=None, **kwargs):
12521253
can also take a value of 'z' to apply parameters to the
12531254
z axis.
12541255
1255-
.. versionadded :: 1.1.0
1256+
.. versionadded:: 1.1.0
12561257
This function was added, but not tested. Please report any bugs.
12571258
"""
12581259
_x = axis in ['x', 'both']
@@ -1287,7 +1288,7 @@ def tick_params(self, axis='both', **kwargs):
12871288
.. note::
12881289
Axes3D currently ignores some of these settings.
12891290
1290-
.. versionadded :: 1.1.0
1291+
.. versionadded:: 1.1.0
12911292
"""
12921293
cbook._check_in_list(['x', 'y', 'z', 'both'], axis=axis)
12931294
if axis in ['x', 'y', 'both']:
@@ -1306,7 +1307,7 @@ def invert_zaxis(self):
13061307
"""
13071308
Invert the z-axis.
13081309
1309-
.. versionadded :: 1.1.0
1310+
.. versionadded:: 1.1.0
13101311
This function was added, but not tested. Please report any bugs.
13111312
"""
13121313
bottom, top = self.get_zlim()
@@ -1316,7 +1317,7 @@ def zaxis_inverted(self):
13161317
"""
13171318
Returns True if the z-axis is inverted.
13181319
1319-
.. versionadded :: 1.1.0
1320+
.. versionadded:: 1.1.0
13201321
"""
13211322
bottom, top = self.get_zlim()
13221323
return top < bottom
@@ -1325,7 +1326,7 @@ def get_zbound(self):
13251326
"""
13261327
Return the lower and upper z-axis bounds, in increasing order.
13271328
1328-
.. versionadded :: 1.1.0
1329+
.. versionadded:: 1.1.0
13291330
"""
13301331
bottom, top = self.get_zlim()
13311332
if bottom < top:
@@ -1340,7 +1341,7 @@ def set_zbound(self, lower=None, upper=None):
13401341
This method will honor axes inversion regardless of parameter order.
13411342
It will not change the autoscaling setting (`.get_autoscalez_on()`).
13421343
1343-
.. versionadded :: 1.1.0
1344+
.. versionadded:: 1.1.0
13441345
"""
13451346
if upper is None and np.iterable(lower):
13461347
lower, upper = lower

0 commit comments

Comments
 (0)