Komischerweise taucht der strich jetzt auch bei plt.show() auf ?
Vielleicht liegt das Problem doch innerhalb meines Codes...
Hier mein Lieblingsbeispiel:
Code: Alles auswählen
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
delta = 10.
r = 28.
b = 8./3.
dt = 1e-3
Nt = 4e4
x = np.zeros(Nt+1)
y = np.zeros(Nt+1)
z = np.zeros(Nt+1)
x[0] = 1.
y[0] = 1.
z[0] = 1.
for i in range(int(Nt)):
x[i+1] = (delta * (y[i]-x[i])) * dt + x[i]
y[i+1] = (-x[i]*z[i] + r*x[i] - y[i]) * dt + y[i]
z[i+1] = (x[i] * y[i] - b * z[i]) * dt + z[i]
if i in range(0,int(Nt)+10000,10000):
fig = plt.figure(facecolor='white', figsize=(12,5))
ax = fig.add_subplot(1,2,2)
plt.ticklabel_format(style='sci', axis='x', scilimits=(0,4))
h1, = ax.plot(x,'b', lw='1.')
h2, = ax.plot(y,'r', lw='1.')
h3, = ax.plot(z,'g', lw='1.')
plt.xlim(0, Nt)
plt.ylim(-30, 50)
plt.legend([h1, h2, h3], ['x', 'y', 'z'])
plt.xlabel('number of timesteps')
plt.ylabel('values')
ax.grid()
ax = fig.add_subplot(1,2,1,projection='3d')
ax.plot(x,y,z,'b')
ax.set_xlim(-20, 20)
ax.set_ylim(-25, 25)
ax.set_zlim(0, 50)
ax.set_xlabel("X Axis")
ax.set_ylabel("Y Axis")
ax.set_zlabel("Z Axis")
plt.show()
#fig.savefig('/XX/YY/lorenz_%05d.png' % i)
Auch sind im rechten subplot die unberechneten Werte um Null, wo eigentlich keine seien sollten ?
Ich bitte um eure Hilfe
