1
Ich versuche, die Gauß-Funktion mit Matplotlib plotten. Dies ist mein Code:Gauss-Funktion Python
#!/usr/bin/env python
from matplotlib import pyplot as plt
import numpy as np
import math
def gaussian(x, alpha, r):
return 1./(math.sqrt(alpha**math.pi))*np.exp(-alpha*np.power((x - r), 2.))
x = np.linspace(-3, 3, 100)
plt.plot(gaussian(x, 1, 0))
plt.show()
Warum der Bereich von 0 bis 100 ist stattdessen zwischen -3 und 3 zu sein?
Super! Vielen Dank! – Monica