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

Skip to content

Commit 38a35b7

Browse files
committed
rst seealso -> numpydoc "See Also".
1 parent 6e8d6e9 commit 38a35b7

File tree

9 files changed

+77
-89
lines changed

9 files changed

+77
-89
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ def _process_plot_format(fmt):
4141
* 'r--': red dashed lines
4242
* 'C2--': the third color in the color cycle, dashed lines
4343
44-
.. seealso::
45-
46-
:func:`~matplotlib.Line2D.lineStyles` and
47-
:attr:`~matplotlib.colors.cnames`
48-
for all possible styles and color format string.
44+
See Also
45+
--------
46+
matplotlib.Line2D.lineStyles, matplotlib.colors.cnames
47+
All possible styles and color format strings.
4948
"""
5049

5150
linestyle = None

lib/matplotlib/collections.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -636,14 +636,14 @@ def set_color(self, c):
636636
"""
637637
Set both the edgecolor and the facecolor.
638638
639-
.. seealso::
640-
641-
:meth:`set_facecolor`, :meth:`set_edgecolor`
642-
For setting the edge or face color individually.
643-
644639
Parameters
645640
----------
646-
c : matplotlib color arg or sequence of rgba tuples
641+
c : color or sequence of rgba tuples
642+
643+
See Also
644+
--------
645+
Collection.set_facecolor, Collection.set_edgecolor
646+
For setting the edge or face color individually.
647647
"""
648648
self.set_facecolor(c)
649649
self.set_edgecolor(c)

lib/matplotlib/colors.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -579,31 +579,34 @@ def reversed(self, name=None):
579579
"""
580580
Make a reversed instance of the Colormap.
581581
582-
.. note :: Function not implemented for base class.
582+
.. note:: Function not implemented for base class.
583583
584584
Parameters
585585
----------
586586
name : str, optional
587587
The name for the reversed colormap. If it's None the
588588
name will be the name of the parent colormap + "_r".
589589
590-
Notes
591-
-----
592-
See :meth:`LinearSegmentedColormap.reversed` and
593-
:meth:`ListedColormap.reversed`
590+
See Also
591+
--------
592+
LinearSegmentedColormap.reversed
593+
ListedColormap.reversed
594594
"""
595595
raise NotImplementedError()
596596

597597

598598
class LinearSegmentedColormap(Colormap):
599-
"""Colormap objects based on lookup tables using linear segments.
599+
"""
600+
Colormap objects based on lookup tables using linear segments.
600601
601602
The lookup table is generated using linear interpolation for each
602603
primary color, with the 0-1 domain divided into any number of
603604
segments.
604605
"""
606+
605607
def __init__(self, name, segmentdata, N=256, gamma=1.0):
606-
"""Create color map from linear mapping segments
608+
"""
609+
Create color map from linear mapping segments
607610
608611
segmentdata argument is a dictionary with a red, green and blue
609612
entries. Each entry should be a list of *x*, *y0*, *y1* tuples,
@@ -639,15 +642,14 @@ def __init__(self, name, segmentdata, N=256, gamma=1.0):
639642
640643
Hence y0 in the first row and y1 in the last row are never used.
641644
645+
See Also
646+
--------
647+
LinearSegmentedColormap.from_list
648+
Static method; factory function for generating a smoothly-varying
649+
LinearSegmentedColormap.
642650
643-
.. seealso::
644-
645-
:meth:`LinearSegmentedColormap.from_list`
646-
Static method; factory function for generating a
647-
smoothly-varying LinearSegmentedColormap.
648-
649-
:func:`makeMappingArray`
650-
For information about making a mapping array.
651+
makeMappingArray
652+
For information about making a mapping array.
651653
"""
652654
# True only if all colors in map are identical; needed for contouring.
653655
self.monochrome = False

lib/matplotlib/patches.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,14 @@ def set_color(self, c):
314314
"""
315315
Set both the edgecolor and the facecolor.
316316
317-
.. seealso::
318-
319-
:meth:`set_facecolor`, :meth:`set_edgecolor`
320-
For setting the edge or face color individually.
321-
322317
Parameters
323318
----------
324319
c : color
320+
321+
See Also
322+
--------
323+
Patch.set_facecolor, Patch.set_edgecolor
324+
For setting the edge or face color individually.
325325
"""
326326
self.set_facecolor(c)
327327
self.set_edgecolor(c)
@@ -927,12 +927,6 @@ def __init__(self, path, **kwargs):
927927
928928
Valid kwargs are:
929929
%(Patch)s
930-
931-
.. seealso::
932-
933-
:class:`Patch`
934-
For additional kwargs
935-
936930
"""
937931
Patch.__init__(self, **kwargs)
938932
self._path = path
@@ -959,12 +953,6 @@ def __init__(self, xy, closed=True, **kwargs):
959953
960954
Valid kwargs are:
961955
%(Patch)s
962-
963-
.. seealso::
964-
965-
:class:`Patch`
966-
For additional kwargs
967-
968956
"""
969957
Patch.__init__(self, **kwargs)
970958
self._closed = closed

lib/matplotlib/path.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -420,16 +420,12 @@ def cleaned(self, transform=None, remove_nans=False, clip=None,
420420
quantize=False, simplify=False, curves=False,
421421
stroke_width=1.0, snap=False, sketch=None):
422422
"""
423-
Cleans up the path according to the parameters returning a new
424-
Path instance.
423+
Returns a new Path after cleaning vertices and codes according to the
424+
parameters.
425425
426-
.. seealso::
427-
428-
See :meth:`iter_segments` for details of the keyword arguments.
429-
430-
Returns
431-
-------
432-
Path instance with cleaned up vertices and codes.
426+
See Also
427+
--------
428+
Path.iter_segments : for details of the keyword arguments.
433429
"""
434430
vertices, codes = _path.cleanup_path(
435431
self, transform, remove_nans, clip, snap, stroke_width, simplify,
@@ -443,12 +439,11 @@ def transformed(self, transform):
443439
"""
444440
Return a transformed copy of the path.
445441
446-
.. seealso::
447-
448-
:class:`matplotlib.transforms.TransformedPath`
449-
A specialized path class that will cache the
450-
transformed result and automatically update when the
451-
transform changes.
442+
See Also
443+
--------
444+
matplotlib.transforms.TransformedPath
445+
A specialized path class that will cache the transformed result and
446+
automatically update when the transform changes.
452447
"""
453448
return Path(transform.transform(self.vertices), self.codes,
454449
self._interpolation_steps)

lib/matplotlib/pyplot.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,15 +1210,13 @@ def subplot2grid(shape, loc, rowspan=1, colspan=1, fig=None, **kwargs):
12101210

12111211
def twinx(ax=None):
12121212
"""
1213-
Make a second axes that shares the *x*-axis. The new axes will
1214-
overlay *ax* (or the current axes if *ax* is *None*). The ticks
1215-
for *ax2* will be placed on the right, and the *ax2* instance is
1216-
returned.
1217-
1218-
.. seealso::
1219-
1220-
:doc:`/gallery/subplots_axes_and_figures/two_scales`
1213+
Make and return a second axes that shares the *x*-axis. The new axes will
1214+
overlay *ax* (or the current axes if *ax* is *None*), and its ticks will be
1215+
on the right.
12211216
1217+
Examples
1218+
--------
1219+
:doc:`/gallery/subplots_axes_and_figures/two_scales`
12221220
"""
12231221
if ax is None:
12241222
ax = gca()
@@ -1228,10 +1226,13 @@ def twinx(ax=None):
12281226

12291227
def twiny(ax=None):
12301228
"""
1231-
Make a second axes that shares the *y*-axis. The new axis will
1232-
overlay *ax* (or the current axes if *ax* is *None*). The ticks
1233-
for *ax2* will be placed on the top, and the *ax2* instance is
1234-
returned.
1229+
Make and return a second axes that shares the *y*-axis. The new axes will
1230+
overlay *ax* (or the current axes if *ax* is *None*), and its ticks will be
1231+
on the top.
1232+
1233+
Examples
1234+
--------
1235+
:doc:`/gallery/subplots_axes_and_figures/two_scales`
12351236
"""
12361237
if ax is None:
12371238
ax = gca()

lib/matplotlib/sankey.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ def __init__(self, ax=None, scale=1.0, unit='', format='%G', gap=0.25,
109109
110110
Sankey().add().add... .add().finish()
111111
112-
.. seealso::
113-
114-
:meth:`add`
115-
:meth:`finish`
116-
112+
See Also
113+
--------
114+
Sankey.add
115+
Sankey.finish
117116
118-
**Examples:**
117+
Examples
118+
--------
119119
120-
.. plot:: gallery/specialty_plots/sankey_basics.py
120+
.. plot:: gallery/specialty_plots/sankey_basics.py
121121
"""
122122
# Check the arguments.
123123
if gap < 0:
@@ -807,9 +807,9 @@ def finish(self):
807807
for the labels of flows
808808
=============== ===================================================
809809
810-
.. seealso::
811-
812-
:meth:`add`
810+
See Also
811+
--------
812+
Sankey.add
813813
"""
814814
self.ax.axis([self.extent[0] - self.margin,
815815
self.extent[1] + self.margin,

lib/matplotlib/spines.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -582,14 +582,13 @@ def set_color(self, c):
582582
583583
Parameters
584584
----------
585-
c : color or sequence of rgba tuples
585+
c : color
586586
587-
.. seealso::
588-
589-
:meth:`set_facecolor`, :meth:`set_edgecolor`
590-
For setting the edge or face color individually.
587+
Notes
588+
-----
589+
This method does not modify the facecolor (which defaults to "none"),
590+
unlike the `Patch.set_color` method defined in the parent class. Use
591+
`Patch.set_facecolor` to set the facecolor.
591592
"""
592-
# The facecolor of a spine is always 'none' by default -- let
593-
# the user change it manually if desired.
594593
self.set_edgecolor(c)
595594
self.stale = True

lib/matplotlib/ticker.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,9 @@ def set_scientific(self, b):
593593
"""
594594
Turn scientific notation on or off.
595595
596-
.. seealso:: Method :meth:`set_powerlimits`
596+
See Also
597+
--------
598+
ScalarFormatter.set_powerlimits
597599
"""
598600
self._scientific = bool(b)
599601

@@ -612,7 +614,9 @@ def set_powerlimits(self, lims):
612614
pre-2007 default in which scientific notation is used for
613615
numbers less than 1e-3 or greater than 1e4.
614616
615-
.. seealso:: Method :meth:`set_scientific`
617+
See Also
618+
--------
619+
ScalarFormatter.set_scientific
616620
"""
617621
if len(lims) != 2:
618622
raise ValueError("'lims' must be a sequence of length 2")

0 commit comments

Comments
 (0)