MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _add_solids

Method _add_solids

lib/matplotlib/colorbar.py:594–614  ·  view source on GitHub ↗

Draw the colors; optionally add separators.

(self, X, Y, C)

Source from the content-addressed store, hash-verified

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:

Callers 1

_draw_allMethod · 0.95

Calls 5

_add_solids_patchesMethod · 0.95
_update_dividersMethod · 0.95
pcolormeshMethod · 0.80
set_rasterizedMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected