labels = 'Python组', 'Java组', 'C组', 'Go组'
sizes = [25, 45, 30, 10]
fig = plt.figure(figsize=(8, 4))
explode1 = (0.1, 0.1, 0.1, 0.1)
ax1 = fig.add_subplot(121)
ax1.pie(sizes, explode=explode1, # 分隔扇形
labels=labels, autopct='%1.1f%%')
explode2 = (0.1, 0, 0, 0)
ax2 = fig.add_subplot(122)
ax2.pie(sizes, explode=explode2, # 分隔扇形
labels=labels, autopct='%1.1f%%')
plt.show()
labels = 'Python组', 'Java组', 'C组', 'Go组'
sizes = [25, 45, 30, 10]
explode = (0.1, 0, 0, 0)
fig1, ax1 = plt.subplots()
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, # 显示阴影
wedgeprops = {'linewidth': 3} # 设置边框宽度
)
plt.show()
labels = 'Python组', 'Java组', 'C组', 'Go组'
sizes = [25, 45, 30, 10]
explode = (0.1, 0, 0, 0)
fig1, ax1 = plt.subplots()
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True,
startangle=90 # 旋转
)
plt.show()
labels = 'Python组', 'Java组', 'C组', 'Go组'
sizes = [25, 45, 30, 10]
explode = (0.1, 0, 0, 0)
fig1, ax1 = plt.subplots()
patches, texts, autotexts = ax1.pie