vacendak icon

Pie Chart

vacendak | PRO | 09/21/20 03:29:50 PM UTC | 0 ⭐ | 1740 👁️ | Never ⏰ | []
Python |

410 B

|

None

|

0 👍

/

0 👎

import matplotlib.pyplot as plt
import numpy as np
 
 
Z = np.full(19, 1)
Z = list(Z)
Z.append(2)
explode = np.full(19, 0.05)
explode = list(explode)
explode.append(0.1)
_, fig1 = plt.subplots(figsize=(10, 6))
theme = plt.get_cmap('Greys_r')
fig1.set_prop_cycle("color", [theme(1. * i / len(Z)) for i in range(len(Z))])
plt.pie(Z, explode=explode, wedgeprops={'edgecolor': 'black', 'radius': 1.4})
plt.show()
 

Comments