Errors with textprops keys
in
The Complete Data Visualization Course with Python, R, Tableau, and Excel
/
Pie Chart - Python - How to Create a Pie Chart
I'm getting two errors in textprops due to size and rotation. One solution :
plt.figure(figsize=(10, 10))
_, _, p = plt.pie(df_fuel_engine_type["Number of Cars"],
labels=df_fuel_engine_type["Engine Fuel Type"].values,
autopct="%.2f%%",
textprops={'fontsize': 'x-large',
'fontweight': 'bold',
'color': 'w'})
[t.set_rotation(30) for t in p]
plt.legend()
plt.title("Cars by Engine Fuel Type", fontsize=18, fontweight="bold")
plt.show()
1 answers ( 0 marked as helpful)
Thanks for the suggestion! Hopefully other students will benefit from your advice as well!
Best,
365 Eli