Last active
August 29, 2015 14:05
A Python Script to plot a sequence of complex points and the corresponding derivatives for each point.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def plotComplexPointsAndVectors(locations, derivatives): | |
X,Y = zip(*map(lambda x: (x.real, x.imag), locations)) | |
U,V = zip(*map(lambda x: (x.real, x.imag), derivatives)) | |
plt.plot(X,Y, "ro-", label="python") | |
limit = np.max(np.ceil(np.absolute(points))) | |
plt.xlim((-limit, limit)) | |
plt.ylim((-limit, limit)) | |
plt.xlabel("Real") | |
plt.ylabel("Imaginary") | |
plt.quiver(X,Y,U,V, linewidths = 2) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment