Why do the pie labels overlap when the wedges are very small in MATLAB 7.14 (R2012a)?
68 views (last 30 days)
Show older comments
MathWorks Support Team
on 6 Jun 2012
Edited: MathWorks Support Team
on 18 Jun 2018
When plotting a pie diagram it may happen that the text objects (stating the percentage) are overlapping, i.e.:
pie([.1 .1 3 5 10])
Accepted Answer
MathWorks Support Team
on 18 Jun 2018
The ability to avoid overlapping of text objects created by the PIE function is not available in MATLAB. The problem occurs because there are two relatively small adjacent slivers (maybe < 2% of the total pie).
To work around this issue, you could use the EXPLODE syntax of PIE to push one of the adjacent slivers out a bit, thus separating their respective labels. The following pie chart avoids the overlapping labels:
pie([.1 .1 3 5 10],[1 0 0 0 0])
The logical vector represents which pie pieces to push out. You could identify this case and explode one of the pair of adjacent slices.
0 Comments
More Answers (0)
See Also
Categories
Find more on Pie Charts in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!