Draw the colors; optionally add separators.
(self, X, Y, C)
| 592 | self._add_solids(X, Y, self._values[ind, np.newaxis]) |
| 593 | |
| 594 | def _add_solids(self, X, Y, C): |
| 595 | """Draw the colors; optionally add separators.""" |
| 596 | # Cleanup previously set artists. |
| 597 | if self.solids is not None: |
| 598 | self.solids.remove() |
| 599 | for solid in self.solids_patches: |
| 600 | solid.remove() |
| 601 | # Add new artist(s), based on mappable type. Use individual patches if |
| 602 | # hatching is needed, pcolormesh otherwise. |
| 603 | mappable = getattr(self, 'mappable', None) |
| 604 | if (isinstance(mappable, contour.ContourSet) |
| 605 | and any(hatch is not None for hatch in mappable.hatches)): |
| 606 | self._add_solids_patches(X, Y, C, mappable) |
| 607 | else: |
| 608 | self.solids = self.ax.pcolormesh( |
| 609 | X, Y, C, cmap=self.cmap, norm=self.norm, alpha=self.alpha, |
| 610 | edgecolors='none', shading='flat') |
| 611 | if not self.drawedges: |
| 612 | if len(self._y) >= self.n_rasterize: |
| 613 | self.solids.set_rasterized(True) |
| 614 | self._update_dividers() |
| 615 | |
| 616 | def _update_dividers(self): |
| 617 | if not self.drawedges: |
no test coverage detected