MCPcopy
hub / github.com/matplotlib/matplotlib / _draw_shape

Method _draw_shape

lib/matplotlib/widgets.py:3819–3835  ·  view source on GitHub ↗
(self, extents)

Source from the content-addressed store, hash-verified

3817 self.extents = self.extents
3818
3819 def _draw_shape(self, extents):
3820 x0, x1, y0, y1 = extents
3821 xmin, xmax = sorted([x0, x1])
3822 ymin, ymax = sorted([y0, y1])
3823 xlim = sorted(self.ax.get_xlim())
3824 ylim = sorted(self.ax.get_ylim())
3825
3826 xmin = max(xlim[0], xmin)
3827 ymin = max(ylim[0], ymin)
3828 xmax = min(xmax, xlim[1])
3829 ymax = min(ymax, ylim[1])
3830
3831 self._selection_artist.set_x(xmin)
3832 self._selection_artist.set_y(ymin)
3833 self._selection_artist.set_width(xmax - xmin)
3834 self._selection_artist.set_height(ymax - ymin)
3835 self._selection_artist.set_angle(self.rotation)
3836
3837 def _set_active_handle(self, event):
3838 """Set active handle based on the location of the mouse event."""

Callers 1

extentsMethod · 0.95

Calls 7

get_xlimMethod · 0.45
get_ylimMethod · 0.45
set_xMethod · 0.45
set_yMethod · 0.45
set_widthMethod · 0.45
set_heightMethod · 0.45
set_angleMethod · 0.45

Tested by

no test coverage detected