Skip to content

Instantly share code, notes, and snippets.

@LeJit
Last active August 29, 2015 14:05
Show Gist options
  • Save LeJit/562d525407d494cbd55e to your computer and use it in GitHub Desktop.
Save LeJit/562d525407d494cbd55e to your computer and use it in GitHub Desktop.
A Python Script to plot a sequence of complex points and the corresponding derivatives for each point.
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