Home>Article>Backend Development> What is the main function of Matplotlib?
What is the main function of Matplotlib?
The main function of Matplotlib is to generate drawings, histograms, power spectra, bar charts, error plots, scatter plots, etc. Matplotlib is a Python 2D drawing library. Produce publication-quality graphics in a variety of hardcopy formats and in a cross-platform interactive environment.
Plotting example
import matplotlib.pyplot as plt import numpy as np x = np.linspace(0,2*np.pi,100) y = np.sin(x) plt.plot(x,y) plt.show()
Matplotlib architecture
The architecture can be divided into three levels.
Backend
This layer mainly deals with where to display and draw the image.
Middle layer Artist
This layer mainly deals with how the image is displayed, such as the legend, line size and color, etc.
The top layer Scripting
pylot, python syntax and api layer interact directly with the user and draw pictures through the program.
Recommended tutorials: "PHP" "Python Tutorial"
The above is the detailed content of What is the main function of Matplotlib?. For more information, please follow other related articles on the PHP Chinese website!