Black Lives Matter. Please consider donating to Black Girls Code today.

Rectangle choropleth grid

I want to draw a simple choropleth with rectangle grid over New York. I have the coordinates of top-left and bottom-right points of each rectangle, which I transformed to shapely Polygons and added to the dataframe, where I have ‘count’ and ‘shape’ columns, but not sure how to draw them properly. I see that generally plotly lacks a simple way to render a custom choropleth grid which is really disappointing

For custom geographical data, you can take a look at the county choropleth figure factory (https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/plotly/figure_factory/_county_choropleth.py). Basically, each cell is a scatter plot with lines, and filled with the right color.