Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to plot points on top of cplot? #70

Open
kaceyaurum opened this issue Oct 14, 2022 · 5 comments
Open

How to plot points on top of cplot? #70

kaceyaurum opened this issue Oct 14, 2022 · 5 comments

Comments

@kaceyaurum
Copy link

I used cplot to graph a complex function, and I want to mark certain points in the complex plane. How can I do this?

@nschloe
Copy link
Owner

nschloe commented Oct 14, 2022

How would you plot the points with mpl?

@kaceyaurum
Copy link
Author

I would like to use matplotlib.pyplot.scatter, but I am not sure how to format my input with the complex plane.

@nschloe
Copy link
Owner

nschloe commented Oct 15, 2022

mpl doesn't know it's a complex plane. You can just scatterplot over the cplot and x-y-coordinates.

@kaceyaurum
Copy link
Author

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?

@nschloe
Copy link
Owner

nschloe commented Oct 15, 2022

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants