✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Display k-means clusters on a Choropleth Map

I’m making a choropleth map using plotly.graph_objects.Choroplethmapbox. I would like to add skleran k-means clusters to overlay on top of this map. I already have the code to calculate the k-means clusters which work when I display them on a scatter plot (plotly.graph_objects.Scatter), and I want to try to use this code with as little modification as possible to mark the locations of K-means cluster centroids on the choropleth map.

My first question is whether or not it is possible to display k-means clusters on a choropleth map, as I have not found any sources or documentation that indicate that it is. Secondly, if it is possible, how can I do it?

If necessary to answer my second question, I can post the relevant snippets of my current code.

Hi @mkr64294 you can use scattermapbox for this.

Does Scattermapbox support choropleth maps? It looks like it just does scatterplots.