Quiver
Verfasst: Donnerstag 19. August 2010, 15:15
Hi, wie mache ich das die quiver funktion von Matplotlib, alle Pfeile gleich lang macht?
LG
Mathek
LG
Mathek
Seit 2002 Diskussionen rund um die Programmiersprache Python
https://www.python-forum.de/
Code: Alles auswählen
In [187]: U = np.random.randint(1, 10, (5, 5))
In [188]: V = np.random.randint(1, 10, (5, 5))
In [189]: a = U + V * 1j
In [190]: b = a / abs(a)
In [191]: pylab.quiver(b.real, b.imag)
Out[191]: <matplotlib.quiver.Quiver object at 0x9a87c6c>
In [192]: pylab.show()
Code: Alles auswählen
In [20]: u = U / np.sqrt(U**2 + V**2)
In [21]: v = V / np.sqrt(U**2 + V**2)