I have pie charts with relatively long texts assigned to each slice of the pie.
The text is drawn horizontally. Instead, I would like to have it rotated at the
same angle as the slice itself (i.e. centered at the "axis" of the slice). In this
way the text would not overlap other text of adjacent slices (or at least if the
text starts far enough from the pie).
The example below is a bit over-twisted but I really want to be able to read at
least a portion of those ['my text4', 'my text5', 'my text6', 'my text7'] legends.
F = pylab.gcf()
ax_pie = pylab.axes([0.30, 0.30, 0.4, 0.4])
_data = [0.17, 0.23, 0.599, 0.001, 0.003, 0.003, 0.003]
_colors=['red', 'green', 'blue', 'black', 'white', 'yellow', 'violet']
_labels=['my text1', 'my text2', 'my text3', 'my text4', 'my text5', 'my text6', 'my text7']
ax_pie.pie(_data, colors=_colors, labels=_labels, labeldistance=1.5, autopct='%1.1f%%')
I tried to search for some example of this or documentation of the pie function
but it seems it is either not possible or not documented.
Some relatively close matches I found:
could maybe help but I do not know at what angle is each slice rendered by pylab.pie())
(maybe this would work if all text should be drawn at a SAME angle but that is not what I want)
http://guutaranoheya.web.fc2.com/math/matplotlib_ex.html (search for "rotation")
Thank you for your help,