*patches* a sequence of Patch objects. This list may include a heterogeneous assortment of different patch types. *match_original* If True, use the colors and linewidths of the original patches. If False, new colors may be assigned
(self, patches, match_original=False, **kwargs)
| 1667 | """ |
| 1668 | |
| 1669 | def __init__(self, patches, match_original=False, **kwargs): |
| 1670 | """ |
| 1671 | *patches* |
| 1672 | a sequence of Patch objects. This list may include |
| 1673 | a heterogeneous assortment of different patch types. |
| 1674 | |
| 1675 | *match_original* |
| 1676 | If True, use the colors and linewidths of the original |
| 1677 | patches. If False, new colors may be assigned by |
| 1678 | providing the standard collection arguments, facecolor, |
| 1679 | edgecolor, linewidths, norm or cmap. |
| 1680 | |
| 1681 | If any of *edgecolors*, *facecolors*, *linewidths*, |
| 1682 | *antialiaseds* are None, they default to their |
| 1683 | :data:`matplotlib.rcParams` patch setting, in sequence form. |
| 1684 | |
| 1685 | The use of :class:`~matplotlib.cm.ScalarMappable` is optional. |
| 1686 | If the :class:`~matplotlib.cm.ScalarMappable` matrix _A is not |
| 1687 | None (i.e., a call to set_array has been made), at draw time a |
| 1688 | call to scalar mappable will be made to set the face colors. |
| 1689 | """ |
| 1690 | |
| 1691 | if match_original: |
| 1692 | def determine_facecolor(patch): |
| 1693 | if patch.get_fill(): |
| 1694 | return patch.get_facecolor() |
| 1695 | return [0, 0, 0, 0] |
| 1696 | |
| 1697 | kwargs['facecolors'] = [determine_facecolor(p) for p in patches] |
| 1698 | kwargs['edgecolors'] = [p.get_edgecolor() for p in patches] |
| 1699 | kwargs['linewidths'] = [p.get_linewidth() for p in patches] |
| 1700 | kwargs['linestyles'] = [p.get_linestyle() for p in patches] |
| 1701 | kwargs['antialiaseds'] = [p.get_antialiased() for p in patches] |
| 1702 | |
| 1703 | Collection.__init__(self, **kwargs) |
| 1704 | |
| 1705 | self.set_paths(patches) |
| 1706 | |
| 1707 | def set_paths(self, patches): |
| 1708 | paths = [p.get_transform().transform_path(p.get_path()) |
nothing calls this directly
no test coverage detected