Featured image of post Wie man Diagramme mit Python (matplotlib.pyplot) zeichnet

Wie man Diagramme mit Python (matplotlib.pyplot) zeichnet

img_1.png

Was Sie brauchen

  • Google-Konto

Schritte

  1. Gehen Sie auf https://colab.research.google.com/
  2. Wählen Sie “Datei” -> “Neues Notizbuch”
  3. Fügen Sie den folgenden Code ein und führen Sie ihn aus
1
2
3
4
5
6
7
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 2*np.pi, 500)
plt.plot(x, np.sin(x), label="sin curve")
plt.plot(x, np.cos(x), label="cos curve")
plt.legend() # Legende anzeigen
plt.show()

Ausführungsergebnis

img.png

Referenzen

comments powered by Disqus
Erstellt mit Hugo
Theme Stack gestaltet von Jimmy