Skip to content

Commit 71bb7ad

Browse files
committed
Better document the ContourSet API change.
1 parent f017315 commit 71bb7ad

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
``ContourSet`` is now a single Collection
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Prior to this release, `.ContourSet` (the object returned by `~.Axes.contour`)
5+
was a custom object holding multiple `.Collection`\s (and not an `.Artist`)
6+
-- one collection per level, each connected component of that level's contour
7+
being an entry in the corresponding collection.
8+
9+
`.ContourSet` is now instead a plain `.Collection` (and thus an `.Artist`).
10+
The collection contains a single path per contour level; this path may be
11+
non-continuous in case there are multiple connected components.
12+
13+
Setting properties on the ContourSet can now usually be done using standard
14+
collection setters (``cset.set_linewidth(3)`` to use the same linewidth
15+
everywhere or ``cset.set_linewidth([1, 2, 3, ...])`` to set different
16+
linewidths on each level) instead of having to go through the individual
17+
sub-components (``cset.collections[0].set_linewidth(...)``). Note that
18+
during the transition period, it remains possible to access the (deprecated)
19+
``.collections`` attribute; this causes the ContourSet to modify itself to use
20+
the old-style multi-Collection representation.

0 commit comments

Comments
 (0)