|
23 | 23 |
|
24 | 24 | # Import needed for adding manual selection capability to clabel |
25 | 25 | from matplotlib.blocking_input import BlockingContourLabeler |
| 26 | +from matplotlib import docstring |
26 | 27 |
|
27 | 28 | # We can't use a single line collection for contour because a line |
28 | 29 | # collection can have only a single line style, and we want to be able to have |
@@ -667,6 +668,27 @@ def _find_closest_point_on_path(lc, point): |
667 | 668 | return (dmin, xcmin, legmin) |
668 | 669 |
|
669 | 670 |
|
| 671 | +docstring.interpd.update(contour_set_attributes=r""" |
| 672 | +Attributes |
| 673 | +---------- |
| 674 | +ax : `~matplotlib.axes.Axes` |
| 675 | + The Axes object in which the contours are drawn. |
| 676 | +
|
| 677 | +collections : `.silent_list` of `.LineCollection`\s or `.PathCollection`\s |
| 678 | + The `.Artist`\s representing the contour. This is a list of |
| 679 | + `.LineCollection`\s for line contours and a list of `.PathCollection`\s |
| 680 | + for filled contours. |
| 681 | +
|
| 682 | +levels : array |
| 683 | + The values of the contour levels. |
| 684 | +
|
| 685 | +layers : array |
| 686 | + Same as levels for line contours; half-way between |
| 687 | + levels for filled contours. See ``ContourSet._process_colors``. |
| 688 | +""") |
| 689 | + |
| 690 | + |
| 691 | +@docstring.dedent_interpd |
670 | 692 | class ContourSet(cm.ScalarMappable, ContourLabeler): |
671 | 693 | """ |
672 | 694 | Store a set of contour lines or filled regions. |
@@ -707,20 +729,7 @@ class ContourSet(cm.ScalarMappable, ContourLabeler): |
707 | 729 | Keyword arguments are as described in the docstring of |
708 | 730 | `~.Axes.contour`. |
709 | 731 |
|
710 | | - Attributes |
711 | | - ---------- |
712 | | - ax |
713 | | - The axes object in which the contours are drawn. |
714 | | -
|
715 | | - collections |
716 | | - A silent_list of LineCollections or PolyCollections. |
717 | | -
|
718 | | - levels |
719 | | - Contour levels. |
720 | | -
|
721 | | - layers |
722 | | - Same as levels for line contours; half-way between |
723 | | - levels for filled contours. See :meth:`_process_colors`. |
| 732 | + %(contour_set_attributes)s |
724 | 733 | """ |
725 | 734 |
|
726 | 735 | def __init__(self, ax, *args, |
@@ -1378,26 +1387,15 @@ def find_nearest_contour(self, x, y, indices=None, pixel=True): |
1378 | 1387 | return (conmin, segmin, imin, xmin, ymin, dmin) |
1379 | 1388 |
|
1380 | 1389 |
|
| 1390 | +@docstring.dedent_interpd |
1381 | 1391 | class QuadContourSet(ContourSet): |
1382 | 1392 | """ |
1383 | 1393 | Create and store a set of contour lines or filled regions. |
1384 | 1394 |
|
1385 | | - User-callable method: `~.Axes.clabel` |
1386 | | -
|
1387 | | - Attributes |
1388 | | - ---------- |
1389 | | - ax |
1390 | | - The axes object in which the contours are drawn. |
1391 | | -
|
1392 | | - collections |
1393 | | - A silent_list of LineCollections or PolyCollections. |
1394 | | -
|
1395 | | - levels |
1396 | | - Contour levels. |
| 1395 | + This class is typically not instantiated directly by the user but by |
| 1396 | + `~.Axes.contour` and `~.Axes.contourf`. |
1397 | 1397 |
|
1398 | | - layers |
1399 | | - Same as levels for line contours; half-way between |
1400 | | - levels for filled contours. See :meth:`_process_colors` method. |
| 1398 | + %(contour_set_attributes)s |
1401 | 1399 | """ |
1402 | 1400 |
|
1403 | 1401 | def _process_args(self, *args, corner_mask=None, **kwargs): |
|
0 commit comments