✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Choropleth maps and bar charts on the same figure

Hi everyone.
How does one go about placing both a choropleth map and a bar chart on the same figure? I tried make_subplots and then tried to set the row and column arguments on the choropleth trace, but turns out you can’t do that:

ValueError: Trace type 'choropleth' is not compatible with subplot type 'xy'
at grid position (1,2)

What’s the workaround?

If it helps, my intent is to create an animation that involves changes in both a choropleth map and a bar chart simultaneously.

Thank you!

Hi @greatblitz

Welcome to Plotly forum!

You can define mixed ‘mapbox’, ‘xy’ subplotsas follows:

fig = make_subplots(
        rows=1, cols=2,
        specs=[[{'type': 'mapbox'},{'type': 'xy'}]],
        subplot_titles=('Title1 1', 'Title 2'))