matplotlib.widgets provide a simple mechanism for interactive, GUI style plots using matplotlib.
From the matplotlib.widgets page
GUI Neutral widgets
Widgets that are designed to work for any of the GUI backends. All of these widgets require you to predefine
matplotlib.axes.Axes
instance and pass that as the first argument. Matplotlib doesn’t try to be too smart with respect to layout – you will have to figure out how wide and tall you want yourAxes
object to be to accommodate your widget.
There are many useful examples including: