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)
