# Is there a way to display the label of categories in px.pie?

**URL:** <https://community.plotly.com/t/is-there-a-way-to-display-the-label-of-categories-in-px-pie/48069>\
**Category:** 📊 Plotly Python\
**Created:** [December 10, 2020, 2:02pm UTC](https://community.plotly.com/t/is-there-a-way-to-display-the-label-of-categories-in-px-pie/48069 "2020-12-10T14:02:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alpy](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Alpy](https://community.plotly.com/u/Alpy)\
**Post date:** [December 10, 2020, 2:02pm UTC](https://community.plotly.com/t/is-there-a-way-to-display-the-label-of-categories-in-px-pie/48069/1 "2020-12-10T14:02:29Z")

</div>

Hello everyone,

I’m developping an application with Dash and I noticed this:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/1/1de9b4ff0cf6b59da285465b9ed9f577d7a0aa82.png)

I have the label (title) of my categories on the **px.bar** , but not in the **px.pie**. I looked at the Plotly Express website and I did not find a pie chart with a label.

So I’m just wondering if this is possible, and, if yes, how?

My two codes:

```auto
fig_1 = px.bar(tmp_graph_6, x="Catégorie", y="Impact (%)", color="Catégorie", title='Impact par étapes du cycle de vie (%)')
 
fig_2 = px.pie(tmp_graph_4, values="Percentage", names='Ingredients', title='Impact par ingrédient (%)')

```

Thank you very much!

Alpy

---

<div class="post-metadata">

**Author:** ![Alexboiboi](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/alexboiboi/32/6420_2.png) [@Alexboiboi](https://community.plotly.com/u/Alexboiboi)\
**Post date:** [December 10, 2020, 8:16pm UTC](https://community.plotly.com/t/is-there-a-way-to-display-the-label-of-categories-in-px-pie/48069/2 "2020-12-10T20:16:06Z")

</div>

Hi @Alpy,

I don’t know why it doesn’t show by default in a pie chart by you can just add the legend title manually:

```auto
fig_2.update_layout(legend_title='Catégorie')

```

Salut, Alex-

---

<div class="post-metadata">

**Author:** ![nicolaskruchten](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/nicolaskruchten/32/7018_2.png) [@nicolaskruchten](https://community.plotly.com/u/nicolaskruchten)\
**Post date:** [December 10, 2020, 9:32pm UTC](https://community.plotly.com/t/is-there-a-way-to-display-the-label-of-categories-in-px-pie/48069/3 "2020-12-10T21:32:16Z")

</div>

That seems like a bug we should fix, I’ll try to get it into the next release 🙂

See [https://github.com/plotly/plotly.py/issues/2966](https://github.com/plotly/plotly.py/issues/2966) for follow-up.

---

<div class="post-metadata">

**Author:** ![Alpy](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Alpy](https://community.plotly.com/u/Alpy)\
**Post date:** [December 10, 2020, 11:14pm UTC](https://community.plotly.com/t/is-there-a-way-to-display-the-label-of-categories-in-px-pie/48069/4 "2020-12-10T23:14:29Z")

</div>

Thank you very much @Alexboiboi, it’s working just fine. Thank you also @nicolaskruchten, I’ll try it on the next release. : )

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/b/ba4b43a190ccf3282e22d4e2449fa4bc646563ed.png)
