cplot
cplot copied to clipboard
How to plot points on top of cplot?
I used cplot to graph a complex function, and I want to mark certain points in the complex plane. How can I do this?
How would you plot the points with mpl?
I would like to use matplotlib.pyplot.scatter, but I am not sure how to format my input with the complex plane.
mpl doesn't know it's a complex plane. You can just scatterplot over the cplot and x-y-coordinates.
I want to do something like:
ax = cplot.plot(f, (-2.0, +2.0, 400), (-2.0, +2.0, 400))
ax.scatter([.5], [0], s=100, marker='.', c='red')
plt.show(ax)
but this puts the points in the arg scale bar. How can I put the points on the main plot?
Ah, I see. cplot.plot doesn't return the ax, but plt. You'll have to manually find the correct axis to plot to. Maybe it should return ax? Not sure.