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笔记:拼图

 

相关文章:

  • 2022-12-23
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2021-08-13
  • 2021-12-04
猜你喜欢
  • 2022-01-04
  • 2021-09-20
  • 2022-01-15
  • 2021-10-16
  • 2021-07-25
  • 2021-06-14
  • 2021-11-24
相关资源
相似解决方案