Last answered:

10 Nov 2021

Posted on:

04 Nov 2021

0

Errors with textprops keys

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)
Instructor
Posted on:

10 Nov 2021

0

Thanks for the suggestion! Hopefully other students will benefit from your advice as well!

Best,
365 Eli

Submit an answer