Matplotlib example

Matplotlib displays data in figures, that is, windows, Jupyter widgets, etc., each of which can contain one or more axes. The easiest way to create a figure with axes is to use pyplot.subplots and then specify some data with Axes.plot.

  1. Import

[1]:
import matplotlib.pyplot as plt
  1. Create figure with axes

[2]:
fig, ax = plt.subplots()
../_images/matplotlib_mpl-example_5_0.png
  1. Einige Daten auf den Achsen zeichnen

[3]:
fig, ax = plt.subplots()
ax.plot([1, 2, 3, 4], [1, 4, 2, 3])
[3]:
[<matplotlib.lines.Line2D at 0x11b315350>]
../_images/matplotlib_mpl-example_7_1.png