# Kurven-Plot mit Python import math import matplotlib.pyplot as plt N = 100 # Festlegung des Intervalls I, dem die x-Werte entnommen werden # Hier: I = [0, 10] mit der Schrittweite 0.1 X = [(x + N - 100)/10 for x in range(N)] Y1 = [math.sin(x) for x in X] # Berechnung der sin-Werte Y2 = [0 for x in X] Y3 = [math.cos(x) for x in X] Y4 = [math.sqrt(x) for x in X] plt.plot(X, Y1) # plot sinus-Kurve plt.plot(X, Y2) # plot x-Achse plt.plot(X, Y3) # plot cosinus-Kurve plt.plot(X, Y4) # plot squareroot-Kurve # Hier: I = [0.1, 10], da log für x=0 nicht definiert ist X = [(x + N - 100)/10 for x in range(1,N)] Y5 = [math.log(x) for x in X] plt.plot(X, Y5) # plot ln-Kurve plt.show()