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

Method __init__

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

Parameters ---------- ax : matplotlib.axes.Axes The :class:`matplotlib.axes.Axes` instance the button will be placed into. label : str Label for this text box. Accepts string. initial : str Initial value in th

(self, ax, label, initial='',
                 color='.95', hovercolor='1', label_pad=.01)

Source from the content-addressed store, hash-verified

659 """
660
661 def __init__(self, ax, label, initial='',
662 color='.95', hovercolor='1', label_pad=.01):
663 """
664 Parameters
665 ----------
666 ax : matplotlib.axes.Axes
667 The :class:`matplotlib.axes.Axes` instance the button
668 will be placed into.
669
670 label : str
671 Label for this text box. Accepts string.
672
673 initial : str
674 Initial value in the text box
675
676 color : color
677 The color of the box
678
679 hovercolor : color
680 The color of the box when the mouse is over it
681
682 label_pad : float
683 the distance between the label and the right side of the textbox
684 """
685 AxesWidget.__init__(self, ax)
686
687 self.DIST_FROM_LEFT = .05
688
689 self.params_to_disable = [key for key in rcParams if 'keymap' in key]
690
691 self.text = initial
692 self.label = ax.text(-label_pad, 0.5, label,
693 verticalalignment='center',
694 horizontalalignment='right',
695 transform=ax.transAxes)
696 self.text_disp = self._make_text_disp(self.text)
697
698 self.cnt = 0
699 self.change_observers = {}
700 self.submit_observers = {}
701
702 # If these lines are removed, the cursor won't appear the first
703 # time the box is clicked:
704 self.ax.set_xlim(0, 1)
705 self.ax.set_ylim(0, 1)
706
707 self.cursor_index = 0
708
709 # Because this is initialized, _render_cursor
710 # can assume that cursor exists.
711 self.cursor = self.ax.vlines(0, 0, 0)
712 self.cursor.set_visible(False)
713
714 self.connect_event('button_press_event', self._click)
715 self.connect_event('button_release_event', self._release)
716 self.connect_event('motion_notify_event', self._motion)
717 self.connect_event('key_press_event', self._keypress)
718 self.connect_event('resize_event', self._resize)

Callers

nothing calls this directly

Calls 12

_make_text_dispMethod · 0.95
set_ylimMethod · 0.80
vlinesMethod · 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_xlimMethod · 0.45
set_visibleMethod · 0.45
set_facecolorMethod · 0.45

Tested by

no test coverage detected