What is the main function of Matplotlib?

Guanhui
Release: 2020-06-16 14:37:07
original
14439 people have browsed it

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()
Copy after login

What is the main function of Matplotlib?

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Latest issues
Popular Tutorials
More>
Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!