Matplotlib-Beispiel#

Matplotlib stellt Daten in Figuren (Figures) dar, d.h. in Fenstern, Jupyter-Widgets usw., von denen jede eine oder mehre Achsen (Axes) enthalten kann. Die einfachste Möglichkeit, eine Figur mit Achsen zu erstellen, ist die Verwendung von pyplot.subplots um dann mit Axes.plot einige Daten anzugeben:

[1]:
import matplotlib.pyplot as plt

# Create a figure containing a single axes.
fig, ax = plt.subplots()

# Plot some data on the axes.
ax.plot([1, 2, 3, 4], [1, 4, 2, 3])
[1]:
[<matplotlib.lines.Line2D at 0x7f509c203e80>]
../_images/matplotlib_mpl-example_2_1.png