# Python Programm zum Plotten (x-y)-Wertetabelle (A4_2.cpp)
import matplotlib.pyplot as plt              # Python Bibliothek zum Plotten (siehe https://matplotlib.org/ )
import numpy as np                           # Python Bibliothek fuer Mathematisches (siehe https://numpy.org/ )

data = np.genfromtxt("./A4_2.dat")           # Einlesen der berechneten Daten von A4_2.cpp

plt.title(r'Plot der gewählten Funktion')    # Titel der Abbildung
plt.ylabel(r'$f(x)$')                        # Beschriftung y-Achse
plt.xlabel('x')                              # Beschriftung x-Achse
plt.plot(data[:,1],data[:,2], color="blue")  # Plotten der Funktion f(x)

plt.savefig("A4_2.png", bbox_inches="tight") # Speichern der Abbildung als Bild
plt.show()                                   # Zusaetzliches Darstellen der Abbildung im separaten Fenster