最近工作中需要写分析报告,报告中需要有图表展示,以下是利用python画的图,有折线图、柱状图、正负柱状图、堆叠图。以后有机会还会持续更新。。。
1.折线图
import matplotlib.pyplot as plt
x=['A','B','C','D','E','E','G','H','I','J','K','L']
y=[2.79,2.41,2.22,1.9,1.73,1.42,1.10,0.80,0.52,0.37,0.22,0.10]
plt.ylabel("lift",family='Times New Roman',fontsize=22)
plt.xlabel("level",family='Times New Roman',fontsize=22)
plt.ylim(0,3)
plt.xticks(fontsize=16,family='Times New Roman')
plt.yticks(fontsize=16,family='Times New Roman')
plt.title("XXXXlift",family='Microsoft YaHei',fontsize=24)
plt.plot(x,y,'o-')