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

Method _update_selection_poly

lib/matplotlib/widgets.py:853–872  ·  view source on GitHub ↗

Update the vertices of the *self.poly* slider in-place to cover the data range *vmin*, *vmax*.

(self, vmin, vmax)

Source from the content-addressed store, hash-verified

851 self.set_val(valinit)
852
853 def _update_selection_poly(self, vmin, vmax):
854 """
855 Update the vertices of the *self.poly* slider in-place
856 to cover the data range *vmin*, *vmax*.
857 """
858 # The vertices are positioned
859 # 1 ------ 2
860 # | |
861 # 0, 4 ---- 3
862 verts = self.poly.xy
863 if self.orientation == "vertical":
864 verts[0] = verts[4] = .25, vmin
865 verts[1] = .25, vmax
866 verts[2] = .75, vmax
867 verts[3] = .75, vmin
868 else:
869 verts[0] = verts[4] = vmin, .25
870 verts[1] = vmin, .75
871 verts[2] = vmax, .75
872 verts[3] = vmax, .25
873
874 def _min_in_bounds(self, min):
875 """Ensure the new min value is between valmin and self.val[1]."""

Callers 2

__init__Method · 0.95
set_valMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected