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

Skip to content

Commit a9e9405

Browse files
jklymakMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #11090: Clean docstring of CountourSet
1 parent 37cd83f commit a9e9405

File tree

1 file changed

+37
-40
lines changed

1 file changed

+37
-40
lines changed

lib/matplotlib/contour.py

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,42 @@ class ContourSet(cm.ScalarMappable, ContourLabeler):
735735
"""
736736
Store a set of contour lines or filled regions.
737737
738-
User-callable method: clabel
738+
User-callable method: `~.Axes.clabel`
739+
740+
Parameters
741+
----------
742+
ax : `~.axes.Axes`
743+
744+
levels : [level0, level1, ..., leveln]
745+
A list of floating point numbers indicating the contour
746+
levels.
747+
748+
allsegs : [level0segs, level1segs, ...]
749+
List of all the polygon segments for all the *levels*.
750+
For contour lines ``len(allsegs) == len(levels)``, and for
751+
filled contour regions ``len(allsegs) = len(levels)-1``. The lists
752+
should look like::
753+
754+
level0segs = [polygon0, polygon1, ...]
755+
polygon0 = array_like [[x0,y0], [x1,y1], ...]
756+
757+
allkinds : ``None`` or [level0kinds, level1kinds, ...]
758+
Optional list of all the polygon vertex kinds (code types), as
759+
described and used in Path. This is used to allow multiply-
760+
connected paths such as holes within filled polygons.
761+
If not ``None``, ``len(allkinds) == len(allsegs)``. The lists
762+
should look like::
763+
764+
level0kinds = [polygon0kinds, ...]
765+
polygon0kinds = [vertexcode0, vertexcode1, ...]
766+
767+
If *allkinds* is not ``None``, usually all polygons for a
768+
particular contour level are grouped together so that
769+
``level0segs = [polygon0]`` and ``level0kinds = [polygon0kinds]``.
770+
771+
kwargs :
772+
Keyword arguments are as described in the docstring of
773+
`~.Axes.contour`.
739774
740775
Attributes
741776
----------
@@ -754,44 +789,6 @@ class ContourSet(cm.ScalarMappable, ContourLabeler):
754789
"""
755790

756791
def __init__(self, ax, *args, **kwargs):
757-
"""
758-
Draw contour lines or filled regions, depending on
759-
whether keyword arg *filled* is ``False`` (default) or ``True``.
760-
761-
The first three arguments must be:
762-
763-
*ax*: axes object.
764-
765-
*levels*: [level0, level1, ..., leveln]
766-
A list of floating point numbers indicating the contour
767-
levels.
768-
769-
*allsegs*: [level0segs, level1segs, ...]
770-
List of all the polygon segments for all the *levels*.
771-
For contour lines ``len(allsegs) == len(levels)``, and for
772-
filled contour regions ``len(allsegs) = len(levels)-1``. The lists
773-
should look like::
774-
775-
level0segs = [polygon0, polygon1, ...]
776-
polygon0 = array_like [[x0,y0], [x1,y1], ...]
777-
778-
*allkinds*: *None* or [level0kinds, level1kinds, ...]
779-
Optional list of all the polygon vertex kinds (code types), as
780-
described and used in Path. This is used to allow multiply-
781-
connected paths such as holes within filled polygons.
782-
If not ``None``, ``len(allkinds) == len(allsegs)``. The lists
783-
should look like::
784-
785-
level0kinds = [polygon0kinds, ...]
786-
polygon0kinds = [vertexcode0, vertexcode1, ...]
787-
788-
If *allkinds* is not ``None``, usually all polygons for a
789-
particular contour level are grouped together so that
790-
``level0segs = [polygon0]`` and ``level0kinds = [polygon0kinds]``.
791-
792-
Keyword arguments are as described in the docstring of
793-
`~.Axes.contour`.
794-
"""
795792
self.ax = ax
796793
self.levels = kwargs.pop('levels', None)
797794
self.filled = kwargs.pop('filled', False)
@@ -1377,7 +1374,7 @@ class QuadContourSet(ContourSet):
13771374
"""
13781375
Create and store a set of contour lines or filled regions.
13791376
1380-
User-callable method: :meth:`clabel`
1377+
User-callable method: `~.Axes.clabel`
13811378
13821379
Attributes
13831380
----------

0 commit comments

Comments
 (0)