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

Method _update_dividers

lib/matplotlib/colorbar.py:616–638  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

614 self._update_dividers()
615
616 def _update_dividers(self):
617 if not self.drawedges:
618 self.dividers.set_segments([])
619 return
620 # Place all *internal* dividers.
621 if self.orientation == 'vertical':
622 lims = self.ax.get_ylim()
623 bounds = (lims[0] < self._y) & (self._y < lims[1])
624 else:
625 lims = self.ax.get_xlim()
626 bounds = (lims[0] < self._y) & (self._y < lims[1])
627 y = self._y[bounds]
628 # And then add outer dividers if extensions are on.
629 if self._extend_lower():
630 y = np.insert(y, 0, lims[0])
631 if self._extend_upper():
632 y = np.append(y, lims[1])
633 X, Y = np.meshgrid([0, 1], y)
634 if self.orientation == 'vertical':
635 segments = np.dstack([X, Y])
636 else:
637 segments = np.dstack([Y, X])
638 self.dividers.set_segments(segments)
639
640 def _add_solids_patches(self, X, Y, C, mappable):
641 hatches = mappable.hatches * (len(C) + 1) # Have enough hatches.

Callers 2

_add_solidsMethod · 0.95
_do_extendsMethod · 0.95

Calls 5

_extend_lowerMethod · 0.95
_extend_upperMethod · 0.95
set_segmentsMethod · 0.45
get_ylimMethod · 0.45
get_xlimMethod · 0.45

Tested by

no test coverage detected