How to set the labels size on a pie chart

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)