Das ist peinlich, aber ich bin nicht in der Lage, dies plotten:Plotten matplotlib von Nump ndarray
import numpy as np
import matplotlib.pyplot as plt
datf=np.loadtxt(filename, dtype=float,delimiter=" ")
print((datf))
plt.plot(datf[:0], datf[:1])
plt.show()
Dies ist datf
:
[[ 1. 19.778986 ]
[ 1.3625678 -1.9363698]
[ 1.4142136 6.5144132]
[ 1.6901453 3.8092139]
[ 2. -4.0222051]]
Und der Fehler ist:
ValueError: x and y must have same first dimension
Vielen Dank sein. Ich habe das vermisst und hatte keine Ahnung, warum diese Kleinigkeit nicht funktioniert – BaRud