Matplotlib笔记:拼图

import matplotlib.pyplot as plt
move_name = ["雷神3", "速度与激情4", "正义联盟", "蜘蛛侠", "闪电侠", "绿巨人", "阿凡达"]
place_count = [13270, 9945, 7679, 6799, 6101, 4621, 20105]
# 创建画布
plt.figure(figsize=(10, 8), dpi=80)
# 绘制饼图
plt.pie(place_count, labels=move_name, colors=["b", "r", "g", "y", "c", "m"])
plt.axis("equal")
# 显示图例
plt.legend()
# 显示图像支持中文
plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号
plt.show()
 

Matplotlib笔记:拼图