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

Skip to content

Commit d1c0522

Browse files
authored
Merge pull request #11090 from dstansby/contourset-doc
Clean docstring of CountourSet
2 parents a2f65a6 + a601509 commit d1c0522

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
@@ -738,7 +738,42 @@ class ContourSet(cm.ScalarMappable, ContourLabeler):
738738
"""
739739
Store a set of contour lines or filled regions.
740740
741-
User-callable method: clabel
741+
User-callable method: `~.Axes.clabel`
742+
743+
Parameters
744+
----------
745+
ax : `~.axes.Axes`
746+
747+
levels : [level0, level1, ..., leveln]
748+
A list of floating point numbers indicating the contour
749+
levels.
750+
751+
allsegs : [level0segs, level1segs, ...]
752+
List of all the polygon segments for all the *levels*.
753+
For contour lines ``len(allsegs) == len(levels)``, and for
754+
filled contour regions ``len(allsegs) = len(levels)-1``. The lists
755+
should look like::
756+
757+
level0segs = [polygon0, polygon1, ...]
758+
polygon0 = array_like [[x0,y0], [x1,y1], ...]
759+
760+
allkinds : ``None`` or [level0kinds, level1kinds, ...]
761+
Optional list of all the polygon vertex kinds (code types), as
762+
described and used in Path. This is used to allow multiply-
763+
connected paths such as holes within filled polygons.
764+
If not ``None``, ``len(allkinds) == len(allsegs)``. The lists
765+
should look like::
766+
767+
level0kinds = [polygon0kinds, ...]
768+
polygon0kinds = [vertexcode0, vertexcode1, ...]
769+
770+
If *allkinds* is not ``None``, usually all polygons for a
771+
particular contour level are grouped together so that
772+
``level0segs = [polygon0]`` and ``level0kinds = [polygon0kinds]``.
773+
774+
kwargs :
775+
Keyword arguments are as described in the docstring of
776+
`~.Axes.contour`.
742777
743778
Attributes
744779
----------
@@ -757,44 +792,6 @@ class ContourSet(cm.ScalarMappable, ContourLabeler):
757792
"""
758793

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

0 commit comments

Comments
 (0)