In the image shown below, I have a 2D data set where I have identified four clusters labeled [0,1,2,3]
. I'm looking for an algorithm to place the labels in a natural* way for each shape. My first guess was to place them in the "center-of-mass" of the cluster, which is shown below. For contiguous clusters this works fine. For clusters that take a shape as in cluster 0
however, the approach fails. Without using a legend, what would be a better method to place the labels on this image?
* natural here is subjective to some extent, but the point of the labels is to help the viewer associate a certain region in the x-y plane with a number.