笔记
from matplotlib import pyplot as plt
from matplotlib.font_manager import FontProperties
font = FontProperties(fname='C:/Windows/Fonts/msyh.ttc')
plt.rcParams['font.family'] = font.get_name()
a=["猩球崛起3:终极之战","敦刻尔克","蜘蛛侠:英雄归来","战狼2"]
b1=[15746,312,4497,319]
b2=[12357,156,2045,168]
b3=[2358,399,2358,362]
bar_width = 0.2
x1=list(range(len(a)))
x2=[i+bar_width for i in x1]
x3=[i+bar_width*2 for i in x1]
plt.figure(figsize=(20,8),dpi=80)
plt.bar(range(len(a)),b3,width=bar_width,label="9月14日")
plt.bar(x2,b2,width=bar_width,label="9月15日")
plt.bar(x3,b1,width=bar_width,label="9月16日")
plt.legend()
plt.xticks(x2,a)
plt.show()