MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / __init__

Method __init__

site-packages/matplotlib/widgets.py:153–198  ·  view source on GitHub ↗

Parameters ---------- ax : matplotlib.axes.Axes The :class:`matplotlib.axes.Axes` instance the button will be placed into. label : str The button text. Accepts string. image : array, mpl image, Pillow Image Th

(self, ax, label, image=None,
                 color='0.85', hovercolor='0.95')

Source from the content-addressed store, hash-verified

151 """
152
153 def __init__(self, ax, label, image=None,
154 color='0.85', hovercolor='0.95'):
155 """
156 Parameters
157 ----------
158 ax : matplotlib.axes.Axes
159 The :class:`matplotlib.axes.Axes` instance the button
160 will be placed into.
161
162 label : str
163 The button text. Accepts string.
164
165 image : array, mpl image, Pillow Image
166 The image to place in the button, if not *None*.
167 Can be any legal arg to imshow (numpy array,
168 matplotlib Image instance, or Pillow Image).
169
170 color : color
171 The color of the button when not activated
172
173 hovercolor : color
174 The color of the button when the mouse is over it
175 """
176 AxesWidget.__init__(self, ax)
177
178 if image is not None:
179 ax.imshow(image)
180 self.label = ax.text(0.5, 0.5, label,
181 verticalalignment='center',
182 horizontalalignment='center',
183 transform=ax.transAxes)
184
185 self.cnt = 0
186 self.observers = {}
187
188 self.connect_event('button_press_event', self._click)
189 self.connect_event('button_release_event', self._release)
190 self.connect_event('motion_notify_event', self._motion)
191 ax.set_navigate(False)
192 ax.set_facecolor(color)
193 ax.set_xticks([])
194 ax.set_yticks([])
195 self.color = color
196 self.hovercolor = hovercolor
197
198 self._lastcolor = color
199
200 def _click(self, event):
201 if self.ignore(event):

Callers

nothing calls this directly

Calls 8

imshowMethod · 0.80
connect_eventMethod · 0.80
set_navigateMethod · 0.80
set_xticksMethod · 0.80
set_yticksMethod · 0.80
__init__Method · 0.45
textMethod · 0.45
set_facecolorMethod · 0.45

Tested by

no test coverage detected