# Add subtitle to pie chart

**URL:** <https://community.plotly.com/t/add-subtitle-to-pie-chart/468>\
**Category:** 📊 Plotly Python\
**Created:** [February 4, 2016, 1:13pm UTC](https://community.plotly.com/t/add-subtitle-to-pie-chart/468 "2016-02-04T13:13:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rk21](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@rk21](https://community.plotly.com/u/rk21)\
**Post date:** [February 4, 2016, 1:13pm UTC](https://community.plotly.com/t/add-subtitle-to-pie-chart/468/1 "2016-02-04T13:13:00Z")

</div>

Hey,

I am plotting multiple pie charts (for example [https://plot.ly/python/pie-charts/](https://plot.ly/python/pie-charts/) - second chart),  
any idea how do I add subtitle to each pie?  
I don’t mean a title for the whole page.

Thanks!

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [February 4, 2016, 2:29pm UTC](https://community.plotly.com/t/add-subtitle-to-pie-chart/468/2 "2016-02-04T14:29:36Z")

</div>

You should use annotations for this task: [https://plot.ly/python/text-and-annotations/](https://plot.ly/python/text-and-annotations/)

---

<div class="post-metadata">

**Author:** ![pbj](https://avatars.discourse-cdn.com/v4/letter/p/f0a364/32.png) [@pbj](https://community.plotly.com/u/pbj)\
**Post date:** [January 2, 2019, 6:16pm UTC](https://community.plotly.com/t/add-subtitle-to-pie-chart/468/3 "2019-01-02T18:16:23Z")

</div>

I’ve just been resolving the same issue and one thing it’s useful to add here is that you can use relative location to define where to put the titles on each chart.

For example, I have two charts, one in x domain [0,48] and the other in [0.51,1] and I used the code below which seems to do a decent job of aligning the subtitle to the right place

```
layout.update(dict(annotations= [{'x': 0.24, 'y':0.95 
                                      ,'text': 'Previous 30 Days'
                                      ,'font': { 'color': 'rgb(55, 128, 191)', 'size': 14}
                                      ,'showarrow':False, 'xanchor':'center' },
                                     {'x': 0.76, 'y':0.95 
                                      ,'text': 'Last 30 Days' 
                                      ,'font': { 'color': 'rgb(55, 128, 191)', 'size': 14}
                                      ,'showarrow':False, 'xanchor':'center' } ]))
```
