Matplotlib - Textbox Widgets Last Updated : 17 Feb, 2022 Comments Improve Suggest changes Like Article Like Report In this article, we are going to see matplotlib's textbox widget. Matplotlib is a plotting library for the Python programming language. In this article, we will try to plot a graph for different powers(e.g. t^2, t^3, t^9, etc.) using textbox widget. The Textbox is a widget that accepts input from the user. Input can also be formulas so that we can generate a graph based on those formulas. To use this widget we use TextBox() function. It accepts two parameters Figure i.e. graph to use.Text to display with textbox i.e. Label to textBox. Below is the implementation of this widget: Python # Import modules import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import TextBox # Adjust illustration fig, ax = plt.subplots() fig.subplots_adjust(bottom=0.2) t = np.arange(-4.0, 4.0, 0.01) l, = ax.plot(t, np.zeros_like(t), lw=2) # Function to plot graph # according to expression def visualizeGraph(expr): ydata = eval(expr) l.set_ydata(ydata) ax.relim() ax.autoscale_view() plt.draw() # Adding TextBox to graph graphBox = fig.add_axes([0.1, 0.05, 0.8, 0.075]) txtBox = TextBox(graphBox, "Plot: ") txtBox.on_submit(visualizeGraph) txtBox.set_val("t**5") # Plot graph plt.show() Output: Explanation: In the above program, we created a graph for t2 as by default graph. In txtBox labelled as Plot: we can enter the formula we want to view the graph for. Comment More infoAdvertise with us Next Article Matplotlib - Textbox Widgets D devangj9689 Follow Improve Article Tags : Python Python-matplotlib Practice Tags : python Similar Reads Matplotlib - Slider Widget Matplotlib provides several widgets to make interactive plots. Among these widgets, the Slider widget is discussed here. The Slider provides control over the visual properties of the plot.  Slider() is used to place a slider representing a floating point range in a plot on provided axes. Syntax: cla 4 min read Matplotlib - Rectangle Selector Matplotlib is a python library for visualization. It provides various widgets to make the visualization of data simple. There are some cases when there is a need of selection of particular region of a graph. For this interactivity, Matplotlib provides RectangleSelector widget. This widget helps to s 3 min read Python Tkinter - Text Widget Tkinter is a GUI toolkit used in python to make user-friendly GUIs.Tkinter is the most commonly used and the most basic GUI framework available in python. Tkinter uses an object-oriented approach to make GUIs.Note: For more information, refer to Python GUI â tkinter Text WidgetText Widget is used wh 5 min read Python Tkinter - Entry Widget Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. Python with Tkinter is the fastest and easiest way to create GUI applications. Creating a GUI using Tkinter is an easy task.In Python3 Tkinter is come 5 min read What are Widgets in Tkinter? Tkinter is Python's standard GUI (Graphical User Interface) package. tkinter we can use to build out interfaces - such as buttons, menus, interfaces, and various kind of entry fields and display areas. We call these elements Widgets.What are Widgets in Tkinter?In Tkinter, a widget is essentially a g 3 min read Like