17 lines
298 B
Python
17 lines
298 B
Python
from matplotlib import pyplot as plt
|
|
|
|
f = lambda x_prev: 1/4 * (x - 3)
|
|
x = 0
|
|
|
|
reihe = [x]
|
|
|
|
for i in range(100):
|
|
x = f(x)
|
|
reihe.append(x)
|
|
|
|
plt.plot(reihe, marker='o', linestyle='-')
|
|
plt.title("Reihen Plot")
|
|
plt.xlabel("n")
|
|
plt.ylabel("x_n")
|
|
plt.grid()
|
|
plt.savefig("reihen_plot.png", dpi=500) |