Skip to content

Figure out how to get legend for plot_density #144

@martinfleis

Description

@martinfleis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions