#!/usr/bin/python3 import numpy as np # Numpy Library importieren import matplotlib.pyplot as plt from numpy.core.function_base import linspace # Matplotlib für mathematische Plots x_min = -4 x_max = 4 y_min = -2 y_max = 2 # Funktion definieren x = np.linspace(x_min,x_max,200) f_x = x - (1/6)*np.power(x,3) + (1/120)*np.power(x,5) df_x = 1 - (1/2)*np.power(x,2) + (1/24)*np.power(x,4) g_x = np.sin(x) h_x = np.cos(x) # Funktion plotten plt.axis([x_min,x_max,y_min,y_max]) # xmin, xmax, ymin, ymax plt.axhline(linewidth=2, color="gray") plt.axvline(linewidth=2, color="gray") plt.plot(x,f_x, label= r'f(x)') plt.plot(x,df_x, label= r"f'(x)") plt.plot(x,g_x, label= r"g(x)") plt.plot(x,h_x, label= r"h(x)") #plt.plot(x,g_x, label= r'$i_L(t)$') plt.ylabel(r'$y$', size='large', weight="bold", color='blue') plt.xlabel(r'$x$', size='large', weight="bold", color='blue') plt.grid(True) plt.legend() plt.show()