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')