matplotlib.widgets.TextBox#
- class matplotlib.widgets.TextBox(ax, label, initial='', *, color='.95', hovercolor='1', label_pad=0.01, textalignment='left')[source]#
Bases:
AxesWidgetA GUI neutral text input box.
For the text box to remain responsive you must keep a reference to it.
Call
on_text_changeto be updated whenever the text changes.Call
on_submitto be updated whenever the user hits enter or leaves the text entry field.- Attributes:
- Parameters:
- ax
Axes The
Axesinstance the button will be placed into.- labelstr
Label for this text box.
- initialstr
Initial value in the text box.
- colorcolor
The color of the box.
- hovercolorcolor
The color of the box when the mouse is over it.
- label_padfloat
The distance between the label and the right side of the textbox.
- textalignment{'left', 'center', 'right'}
The horizontal location of the text.
- ax
- on_submit(func)[source]#
When the user hits enter or leaves the submission box, call this func with event.
A connection id is returned which can be used to disconnect.
- on_text_change(func)[source]#
When the text changes, call this func with event.
A connection id is returned which can be used to disconnect.
- property text#