728x90
반응형
In [1]:
import numpy as np
import matplotlib.pyplot as plt
soa = np.array([[0, 0, 4, 2], [0, 0, 2, 4], [0, 0, 4.5, 5],[4,2,-2,2]])
X, Y, U, V = zip(*soa)
plt.figure()
ax = plt.gca()
ax.quiver(X, Y, U, V, angles='xy', scale_units='xy', scale=1,color=['g','g','r','b'])
ax.set_xlim([-1, 8])
ax.set_ylim([-1, 8])
plt.draw()
plt.show()
In [2]:
soa = np.array([[0, 0, 5, 0], [0, 0, 3, 6],[3,6,0,-6]])
X, Y, U, V = zip(*soa)
plt.figure()
ax = plt.gca()
ax.quiver(X, Y, U, V, angles='xy', scale_units='xy', scale=1,color=['g','r','b'])
ax.set_xlim([-1, 8])
ax.set_ylim([-1, 8])
plt.draw()
plt.show()
728x90
반응형