Skip to content

Commit a9a7e5c

Browse files
committed
Document API change in ContourSet
Also, update documentation for Attributes. Followup to matplotlib#19623; fixes matplotlib#20906.
1 parent 965932d commit a9a7e5c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

doc/api/prev_api_changes/api_changes_3.5.0/behaviour.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,17 @@ Usually norms have a scale, and the advantage of having a `~.scale.ScaleBase`
184184
attached to a norm is to provide a scale, and associated tick locators and
185185
formatters, for the colorbar.
186186

187+
``ContourSet`` always use ``PathCollection``
188+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189+
190+
In order to correct rendering issues with closed loops, the `.ContourSet` now
191+
creates a `.PathCollection` instead of a `.LineCollection` for line contours.
192+
This type matches the artist used for filled contours.
193+
194+
This affects `.ContourSet` itself and its subclasses, `.QuadContourSet`
195+
(returned by `.Axes.contour`), and `.TriContourSet` (returned by
196+
`.Axes.tricontour`).
197+
187198
``hatch.SmallFilledCircles`` inherits from ``hatch.Circles``
188199
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189200

lib/matplotlib/contour.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,10 +662,9 @@ def _find_closest_point_on_path(xys, p):
662662
ax : `~matplotlib.axes.Axes`
663663
The Axes object in which the contours are drawn.
664664
665-
collections : `.silent_list` of `.LineCollection`\s or `.PathCollection`\s
665+
collections : `.silent_list` of `.PathCollection`\s
666666
The `.Artist`\s representing the contour. This is a list of
667-
`.LineCollection`\s for line contours and a list of `.PathCollection`\s
668-
for filled contours.
667+
`.PathCollection`\s for both line and filled contours.
669668
670669
levels : array
671670
The values of the contour levels.

0 commit comments

Comments
 (0)