Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Figure out how to get legend for plot_density #144

Open
martinfleis opened this issue Aug 14, 2024 · 0 comments
Open

Figure out how to get legend for plot_density #144

martinfleis opened this issue Aug 14, 2024 · 0 comments

Comments

@martinfleis
Copy link
Member

We currently don't expose CountourSet object so adding annotations or legends to the density plot is complicated. We should find a way how to do that elegantly.

Now, you can retrieve it from Axes.collections but that is cumbersome.

f, ax = plt.subplots()
ax = pointpats.plot_density(
    pts,
    bandwidth=500,
)
CS = ax.collections[0]  # this is a bit too complicated imho especially with multiple collections in the axis.
ax.clabel(CS, inline=True, fontsize=10)

Screenshot 2024-08-14 at 15 58 22

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

No branches or pull requests

1 participant