import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl

#解决中文乱码和正负号问题
mpl.rcParams["font.sans-serif"]=["SimHei"]
mpl.rcParams["axes.unicode_minus"]=False

labels=["A难度水平","B难度水平","C难度水平","D难度水平"]

students=[0.35,0.15,0.20,0.30]

colors=["red","blue","green","pink"]

explode=(0.1,0.1,0.1,0.1)

#exploded pie chart
plt.pie(students,explode=explode,labels=labels,
startangle=45,shadow=True,
colors=colors,autopct="%3.1f%%")
plt.title("选择不同难度测试试卷的学生百分比",fontsize=20)
col_labels = ['col1','col2','col3']
row_labels = ['row1','row2']
table_vals = [[11,12,13],[21,22,23]]
row_colors = ['red','gold','green']
plt.table(cellText=table_vals,colWidths=[0.1]*3,
rowLabels=row_labels,colLabels=col_labels,
rowColours=row_colors,colColours=row_colors,
loc="bottom")
plt.show()

相关文章:

  • 2021-11-05
  • 2021-05-18
  • 2021-11-06
  • 2021-06-22
  • 2022-12-23
猜你喜欢
  • 2021-06-27
  • 2021-11-20
  • 2021-04-30
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案