MATLAB Answers

Why do the pie labels overlap when the wedges are very small in MATLAB 7.14 (R2012a)?

58 views (last 30 days)
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
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.

More Answers (0)

Products


Release

R2012a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!