I'm plotting a figure with three subplots:
fig = plt.figure(fignum)
ax11 = plt.subplot2grid((2,2), (0,0))
ax12 = plt.subplot2grid((2,2), (0,1))
ax13 = plt.subplot2grid((2,2), (1,0), colspan=2)
ax13.axis('off')
I'm using Pandas for my data and I want to plot a bar chart, a pie chart, and a table. I'm doing this:
d = pd.Series(data,index)
#plotting the first subplot
d.plot(kind='bar',ax=ax11)
#plotting the second one and adjusting size of labels and percentages
(wedges, texts, autotexts) = ax12.pie(d,labels=d.index,autopct='%1.1f%%')
ax12.axis('equal')
for t in texts:
t.set_size(7)
for t in autotexts:
t.set_size(7)
#plotting the third axes, the table
ax13.table(cellText=table,colLabels=columns,loc='bottom')
This is how it turns out:
How can I make the pie chart look better by not having the labels overlap? I've tried adding a legend but it covers up the chart and I don't even know if it's ending up in the location I'm specifying:
ax12.legend(index,loc='lower right',fontsize=7)
Is there a way to move the legend down into that empty space under the pie chart? I'll remove the labels from the pie chart itself once the legend looks good.