matplotlib画cdf(累积分布函数)图

cdf解释:

http://baike.baidu.com/link?url=LH1cGO2Swa-khHN83Rc1ln2OGcDCh7Sbcq2wMSFBRJWA_bm_GUFyaEBOvrEM80uWpQfrY7EPQkekp6_ZBjXGUq

 

import numpy as np
from pylab import *

# Create some test data
dict1 = {1:1.22,2:1.26,3:8.9}
a = dict1.keys()
b = []
for key in a:
    b.append(dict1[key])

# Plot both

xlabel('number')
ylabel('percentage(%)')
plot(a,b)

savefig(os.path.join(os.getcwd(),'pie.png'))

show()

posted @ 2014-05-27 18:34  pp_sunlight  阅读(4848)  评论(0编辑  收藏  举报