Home  >  Article  >  Backend Development  >  What is the main function of Matplotlib?

What is the main function of Matplotlib?

Guanhui
GuanhuiOriginal
2020-06-16 14:37:0714721browse

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()

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!

Statement:
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 admin@php.cn