matplotlib实现物流配送中心EIQ分析的图表

from pandas import Series,DataFrame
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

fig=plt.figure()
ax=fig.add_subplot(1,1,1)
data=np.random.randn(20)
data.sort()
data=abs(data)
data=sorted(data,reverse=True)
s=Series(data,index=np.arange(20))
s.plot(kind='bar',color='g',)
ax.set_xlabel('order')
ax.set_ylabel('time')

ax2=plt.twinx()#双坐标轴
ax2.set_ylabel('frequency')
data1=s.cumsum()
datamax=data1[19]
data1=data1/datamax
data1.plot(linestyle='--',color='k')

posted @ 2018-07-19 16:26  绮梦璇玑  阅读(717)  评论(0编辑  收藏  举报