The simplest way to change the font size on a pie chart is directly via the textprops
argument in the pie()
function. Using the code above add it like so:
ax.pie(frac, colors=colors ,labels=labels,
autopct="%1.1f%%", textprops={'fontsize': 14})
That way you can just pass in a dictionary with your desired fontsize (e.g., 14). No messing around with rcParams
or return values from the function call.