# Readable TPie without fine tuning?

**URL:** <https://root-forum.cern.ch/t/readable-tpie-without-fine-tuning/55338>\
**Category:** Newbie\
**Tags:** graphics\
**Created:** [June 17, 2023, 12:46pm UTC](https://root-forum.cern.ch/t/readable-tpie-without-fine-tuning/55338 "2023-06-17T12:46:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc1uk](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/marc1uk/32/19390_2.png) [@marc1uk](https://root-forum.cern.ch/u/marc1uk)\
**Post date:** [June 17, 2023, 12:46pm UTC](https://root-forum.cern.ch/t/readable-tpie-without-fine-tuning/55338/1 "2023-06-17T12:46:40Z")

</div>

* * *

_ROOT Version:_ 6.06.08  
_Platform:_ Linux  
_Compiler:_ g++6.3

* * *

Simple question here, but I’m trying to make TPie charts, but when the slices are small the labels end up overlapping.

 ![Screenshot_2023-06-17_13-23-21](https://root-forum.cern.ch/uploads/default/original/3X/e/c/ec638314f51585ec748cd9bb67d13e17beac5554.png)  
Reducing the amount of information shown and moving the labels to a legend (along with changing the default colors, which are all very similar?) helps:  
 ![Screenshot_2023-06-17_13-41-57](https://root-forum.cern.ch/uploads/default/original/3X/5/f/5f0a0b16f86e519b947ba351ef2987e8848d74de.png)  
But even now there are still two entries (O17 and Gd153) whose labels overlap and whose slices aren’t distinguishable - even if you can identify that there are two numbers there, and what they are, you can’t tell which is which.  
Google sheets does this with no configuration:  
 ![Screenshot_2023-06-17_13-38-58](https://root-forum.cern.ch/uploads/default/original/3X/e/a/ea116e19474f90bd41fc088c57d19bafaf431afa.png)  
Which is a pretty good way to separate out the labels without overlap. The only flaw, in fact, is that the O17 entry seems to be entirely missing…! 🤨

Anyway, surely there’s some way to draw a pie chart that’s readable, preferably without (although i can’t even do it with) fine tuning the plot for the specific bin contents…?

---

<div class="post-metadata">

**Author:** ![Eddy\_Offermann](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eddy_offermann/32/25079_2.png) [@Eddy\_Offermann](https://root-forum.cern.ch/u/Eddy_Offermann)\
**Post date:** [June 18, 2023, 8:47am UTC](https://root-forum.cern.ch/t/readable-tpie-without-fine-tuning/55338/2 "2023-06-18T08:47:05Z")

</div>

Are you sure that a pie chart is the best way to represent your information here ?When distribution entries start varying across orders of magnitude, logarithms are helpful.

---

<div class="post-metadata">

**Author:** ![marc1uk](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/marc1uk/32/19390_2.png) [@marc1uk](https://root-forum.cern.ch/u/marc1uk)\
**Post date:** [June 19, 2023, 12:13pm UTC](https://root-forum.cern.ch/t/readable-tpie-without-fine-tuning/55338/3 "2023-06-19T12:13:32Z")

</div>

Well, in this case it’s a breakdown of what fraction of neutrons captured on various nuclei; we expect ~50% on hydrogen and ~50% across a few gadolinium isotopes, so a pie chart seemed like a good way to show that. The other isotopes are edge cases, hence the small numbers, but I think they’re interesting all the same. I’m open to an alternative suggestion, but since there’s a TPie class it would be nice to get a good plot out of it, regardless of whether that’s the “best” way to represent the data.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [June 19, 2023, 12:43pm UTC](https://root-forum.cern.ch/t/readable-tpie-without-fine-tuning/55338/4 "2023-06-19T12:43:58Z")

</div>

The current implementation of TPie does not support the arrows style Google provides. But as @Eddy_Offermann said, if some of your slices are not bigger than a simple line, does it make real sense to use a Pie Chart to represent your data?

---

<div class="post-metadata">

**Author:** ![marc1uk](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/marc1uk/32/19390_2.png) [@marc1uk](https://root-forum.cern.ch/u/marc1uk)\
**Post date:** [June 19, 2023, 12:48pm UTC](https://root-forum.cern.ch/t/readable-tpie-without-fine-tuning/55338/5 "2023-06-19T12:48:18Z")

</div>

I’m not sure what would be more suitable, but ok, i’ll give up on TPie for now. As a final note, though, I will point out that even the demonstration pie chart on the TPie class reference page, with no small slices, still suffers from this issue.  
 ![Screenshot_2023-06-19_13-45-29](https://root-forum.cern.ch/uploads/default/original/3X/a/4/a49fc5ffd67cc07c7f15ce82bae31ac012cf0f70.png)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [June 19, 2023, 1:00pm UTC](https://root-forum.cern.ch/t/readable-tpie-without-fine-tuning/55338/6 "2023-06-19T13:00:51Z")

</div>

In that case, one can reduce the label size and/or enlarge the distance between the label and the pie. This can be done interactively for fine-tuning.

---

<div class="post-metadata">

**Author:** ![Eddy\_Offermann](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eddy_offermann/32/25079_2.png) [@Eddy\_Offermann](https://root-forum.cern.ch/u/Eddy_Offermann)\
**Post date:** [June 20, 2023, 6:32am UTC](https://root-forum.cern.ch/t/readable-tpie-without-fine-tuning/55338/7 "2023-06-20T06:32:31Z")

</div>

What about a histogram with a logarithmic Y-axis and alpha-numeric X-axis labels ?
