Closed zilch42 closed 2 months ago
Additional info, I have tried running the wikipedia interactive plot example and that runs fine with cluster_boundary_polygons=True
. I have also compared my input data formats with the data in that example and changed the following line to match the format found there:
dummy_label_array = [np.array(l) for l in dummy_labels]
but even with that change I still get the same 'pop from an empty set' error
The boundary shapes are using alpha shapes and can be a bit finicky if the clusters aren't pretty reasonable in the 2D plot, so it is possible boundaries are not going to work out well for your data. With that being said, normally they just provide bad squiggles instead of boundaries in the bad case rather than a hard fail as you have here.
It seems like it is not finding an reasonable boundary for the alpha shape (the search set is empty) which could definitely happen if the alpha is too small. I guess that may depend on the scale of the data. I tried to choose a reasonably robust alpha as the default, but it may be making things go bad in your case. You can set this yourself with polygon_alpha
in the call to create_interactive_plot
. The default value is 0.1
but you can try much larger values (as the value tends to infinity the boundary will tend to the convex hull). Start with something like 10
and see if that stops things from breaking.
I'll see if I can manage to have a more useful error message result if this happens.
Thanks! Yes alpha = 10 works. Even alpha = 1 works. For what it's worth, I've just been playing with tiny datasets because it's quick to process and play around with, and that's where I'm finding these errors, but generally DataMapPlot isn't a great tool for tiny datasets. It's much better when the data is large. So this is probably an edge case, but more informative error messages would be very much appreciated!
I'm getting an error when trying to use
cluster_boundary_polygons=True
with an interactive plot. The plot generates fine ifcluster_boundary_polygons=False
, and static plots generate fine with the same data. I thought it might have been an issue with having too few points per cluster but I've tried doubling the lists (min 6 points in each cluster) and it still failed there. Any ideas what I'm doing wrong?datamapplot v0.3.0