Creating a Canvas
Swipe um das Menü anzuzeigen
matplotlib has three layers:
- Backend layer: renders plot to screens or files;
- Artist layer: describes how data is arranged, is made up of one object,
Artist; - Scripting layer: connects the previous two layers and simplifies access to them.
The main focus is on the scripting layer with the pyplot module and the artist layer. The artist layer includes the following:
- Containers (e.g.
Figure,Axes); - Primitives (e.g., line, rectangle, circle, text, etc).
Figure is the main Artist object and can be thought of as a canvas where all the plots will be located. Basically, it holds everything together.
On the other hand, Axes is an object made up of two axis objects, x-axis and y-axis.
Note
Figure = canvas, Axes = x-axis + y-axis.
Now let's look at the creation of the Figure and its Axes:
1234import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.plot() plt.show()
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 3
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Abschnitt 1. Kapitel 3