Full Description (Images):
Hi there,
My name is Tony Zeidan and I am currently using the Plotly express API to make a choropleth map of Canada based on a hexagonal grid which is obtained from the Uber H3 (h3-py) library. I have managed to get the right resulting hexagonal grid and made a geo json from it.
When I use the Choropleth Mapbox method, I can only do it in Mercator projection and the result is as follows:
dig = (px.choropleth_mapbox(
merged,
geojson=geojson_obj,
locations='h3_cell',
color='count',
color_continuous_scale="Viridis",
range_color=(0,merged['count'].mean()),mapbox_style='carto-positron',
zoom=7,
center = {"lat": 65.469211, "lon": -136.713865},
opacity=0.7,
labels={'count':'# of fire ignitions '}))
The resulting map returns a correct result (a map with color coded hexagons based on count) but I need it in the Orthographic projection so I decided to use the plotly express Choropleth method instead.
fig = px.choropleth(merged, geojson=geojson_obj, locations='h3_cell', color='count',
color_continuous_scale="Magma",
range_color=(0,merged['count'].mean()),
scope="north america",
center = {"lat": 65.469211, "lon": -136.713865},
labels={'count':'# of fire ignitions'}
)
fig.update_geos(lataxis_showgrid=True, lonaxis_showgrid=True, projection_type='orthographic')
This results in an image of the globe being color coded one color, although when I hover over Canada it shows the correct hexagon cell ids (so they are present). Any advice would be helpful.