# Kurven-Plot # mit Legende # hohe Aufloesung import math import matplotlib.pyplot as plt N = 1000 # Festlegung des Intervalls I, dem die x-Werte entnommen werden # Hier: I = [0, 10] mit der Schrittweite 0.01 X = [(x + N - 1000)/100 for x in range(N)] Y1 = [0 for x in X] Y2 = [math.sin(x) for x in X] Y3 = [math.cos(x) for x in X] Y4 = [math.sqrt(x) for x in X] plt.plot(X, Y1) plt.plot(X, Y2, label="sin") plt.plot(X, Y3, label='cos') plt.plot(X, Y4, label='square-root') # Hier: I = [0.1, 10], da log für x=0 nicht definiert ist X = [(x + N - 1000)/100 for x in range(10,N)] Y5 = [math.log(x) for x in X] plt.plot(X, Y5, label='ln') plt.legend() plt.show()