From 24cfd6b68330173352fbe01f7b62c8d521d0aab0 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Fri, 20 Apr 2018 12:35:52 +0100 Subject: [PATCH 1/2] Clean docstring of CountourSet --- lib/matplotlib/contour.py | 73 +++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 6e473671419e..193ec1ece87c 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -740,6 +740,41 @@ class ContourSet(cm.ScalarMappable, ContourLabeler): User-callable method: clabel + Parameters + ---------- + ax : `~.axes.Axes` + + levels : [level0, level1, ..., leveln] + A list of floating point numbers indicating the contour + levels. + + allsegs : [level0segs, level1segs, ...] + List of all the polygon segments for all the *levels*. + For contour lines ``len(allsegs) == len(levels)``, and for + filled contour regions ``len(allsegs) = len(levels)-1``. The lists + should look like:: + + level0segs = [polygon0, polygon1, ...] + polygon0 = array_like [[x0,y0], [x1,y1], ...] + + allkinds : ``None`` or [level0kinds, level1kinds, ...] + Optional list of all the polygon vertex kinds (code types), as + described and used in Path. This is used to allow multiply- + connected paths such as holes within filled polygons. + If not ``None``, ``len(allkinds) == len(allsegs)``. The lists + should look like:: + + level0kinds = [polygon0kinds, ...] + polygon0kinds = [vertexcode0, vertexcode1, ...] + + If *allkinds* is not ``None``, usually all polygons for a + particular contour level are grouped together so that + ``level0segs = [polygon0]`` and ``level0kinds = [polygon0kinds]``. + + kwargs : + Keyword arguments are as described in the docstring of + `~.Axes.contour`. + Attributes ---------- ax: @@ -757,44 +792,6 @@ class ContourSet(cm.ScalarMappable, ContourLabeler): """ def __init__(self, ax, *args, **kwargs): - """ - Draw contour lines or filled regions, depending on - whether keyword arg *filled* is ``False`` (default) or ``True``. - - The first three arguments must be: - - *ax*: axes object. - - *levels*: [level0, level1, ..., leveln] - A list of floating point numbers indicating the contour - levels. - - *allsegs*: [level0segs, level1segs, ...] - List of all the polygon segments for all the *levels*. - For contour lines ``len(allsegs) == len(levels)``, and for - filled contour regions ``len(allsegs) = len(levels)-1``. The lists - should look like:: - - level0segs = [polygon0, polygon1, ...] - polygon0 = array_like [[x0,y0], [x1,y1], ...] - - *allkinds*: *None* or [level0kinds, level1kinds, ...] - Optional list of all the polygon vertex kinds (code types), as - described and used in Path. This is used to allow multiply- - connected paths such as holes within filled polygons. - If not ``None``, ``len(allkinds) == len(allsegs)``. The lists - should look like:: - - level0kinds = [polygon0kinds, ...] - polygon0kinds = [vertexcode0, vertexcode1, ...] - - If *allkinds* is not ``None``, usually all polygons for a - particular contour level are grouped together so that - ``level0segs = [polygon0]`` and ``level0kinds = [polygon0kinds]``. - - Keyword arguments are as described in the docstring of - `~.Axes.contour`. - """ self.ax = ax self.levels = kwargs.pop('levels', None) self.filled = kwargs.pop('filled', False) From a601509b30881c39f74411c75e817845f6200650 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Sat, 21 Apr 2018 14:19:54 -0700 Subject: [PATCH 2/2] Small edits to make clabel a link --- lib/matplotlib/contour.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 193ec1ece87c..c27d582764cd 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -738,7 +738,7 @@ class ContourSet(cm.ScalarMappable, ContourLabeler): """ Store a set of contour lines or filled regions. - User-callable method: clabel + User-callable method: `~.Axes.clabel` Parameters ---------- @@ -1376,7 +1376,7 @@ class QuadContourSet(ContourSet): """ Create and store a set of contour lines or filled regions. - User-callable method: :meth:`clabel` + User-callable method: `~.Axes.clabel` Attributes ----------