# Pie chart on the map

**URL:** <https://community.plotly.com/t/pie-chart-on-the-map/37242>\
**Category:** 📊 Plotly Python\
**Created:** [April 5, 2020, 11:02am UTC](https://community.plotly.com/t/pie-chart-on-the-map/37242 "2020-04-05T11:02:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ditsuhi](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@Ditsuhi](https://community.plotly.com/u/Ditsuhi)\
**Post date:** [April 5, 2020, 11:02am UTC](https://community.plotly.com/t/pie-chart-on-the-map/37242/1 "2020-04-05T11:02:52Z")

</div>

Hi everyone,  
I would like to know if there is a way to plot pie charts on the map.

Bests,  
Ditsuhi

---

<div class="post-metadata">

**Author:** ![Emmanuelle](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/emmanuelle/32/7853_2.png) [@Emmanuelle](https://community.plotly.com/u/Emmanuelle)\
**Post date:** [April 5, 2020, 1:14pm UTC](https://community.plotly.com/t/pie-chart-on-the-map/37242/2 "2020-04-05T13:14:09Z")

</div>

Hi @Ditsuhi it is possible to some extent but the interaction between the map and the pie is not perfect, since the traces live in different axes. See the example below

```auto
import plotly.express as px
import plotly.graph_objects as go

df = px.data.gapminder().query("year==2007")
fig = px.choropleth(df, locations="iso_alpha",
                    color="lifeExp", # lifeExp is a column of gapminder
                    hover_name="country", # column to add to hover information
                    color_continuous_scale=px.colors.sequential.Plasma)
fig.add_trace(go.Pie(values=[1, 2, 3], domain_x=(0.1, 0.3), domain_y=(0.2, 0.4)))
fig.show()

```

You can control the position of the pie thanks to `domain_x` and `domain_y` (corresponding to plot fractions) but if you pan or zoom on the map the pie will stay at the same place. I don’t think it’s possible to define a pie at a position which is in `geo` axis coordinates.

---

<div class="post-metadata">

**Author:** ![messismore](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@messismore](https://community.plotly.com/u/messismore)\
**Post date:** [March 28, 2022, 3:13pm UTC](https://community.plotly.com/t/pie-chart-on-the-map/37242/3 "2022-03-28T15:13:02Z")

</div>

Is that still the case? I am trying to build something like this: [Matplotlib Basemap tutorial 06: Real Case pie charts – Géophysique.be](https://www.geophysique.be/2010/11/26/matplotlib-basemap-tutorial-06-real-case-pie-charts/)
