Matplotlib.pyplot.text() function in Python Last Updated : 25 Nov, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report This function is used to add a text to the axes at location x, y in data coordinates. Syntax: matplotlib.pyplot.text(x, y, s, fontdict=None, **kwargs)parameters Descriptionx, y:floatThe position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the transform parameter.s :strThe text.fontdict : dict default noneA dictionary to override the default text properties. If fontdict is None, the defaults are determined by rcParams.**kwargsText properties. Example #1: Text on plot sheet Python3 import matplotlib.pyplot matplotlib.pyplot.text(0.5, 0.5, "Hello World!") matplotlib.pyplot.savefig("out.png") Output: Example #2: Add text to a plot Python3 import matplotlib.pyplot as plt w = 4 h = 3 d = 70 plt.figure(figsize=(w, h), dpi=d) x = [1, 2, 4] x_pos = 0.5 y_pos = 3 plt.text(x_pos, y_pos, "text on plot") plt.plot(x) plt.savefig("out.png") Output: Comment More infoAdvertise with us Next Article Matplotlib.pyplot.connect() in Python C codes1004002 Follow Improve Article Tags : Technical Scripter Python Technical Scripter 2020 Python-matplotlib Matplotlib Pyplot-class +1 More Practice Tags : python Similar Reads Matplotlib.pyplot.suptitle() function in Python Matplotlib is a library in Python and it is a mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.suptitle() Function The suptitle() function in pyplot module of the matplotlib library is used to 3 min read Matplotlib.pyplot.plot() function in Python The matplotlib.pyplot.plot() is used to create 2D plots such as line graphs and scatter plots. The plot() function allows us to plot data points, customize line styles, markers and colors making it useful for various types of visualizations. In this article, we'll see how to use this function to plo 3 min read Matplotlib.pyplot.autumn() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 2 min read Matplotlib.pyplot.gci() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 2 min read Matplotlib.pyplot.connect() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.connect() Function This method is used to connect an event with string s to a function. 3 min read Matplotlib.pyplot.bone() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 2 min read Like