Python数据可视化五密度分布图绘

北京哪里治疗白癜风比较好 http://m.39.net/pf/bdfyy/
使用matplotlib包绘制密度分布图

#Importlibrariesimportmatplotlib.pyplotaspltimportnumpyasnpfromscipy.statsimportgaussian_kde

#Builddummydatadata=[1.5]*7+[2.5]*2+[3.5]*8+[4.5]*3+[5.5]*1+[6.5]*8data[1:10][1.5,1.5,1.5,1.5,1.5,1.5,2.5,2.5,3.5]

#Builda"density"functionbasedonthedataset#WhenyougiveavaluefromtheXaxistothisfunction,itreturnstheaccordingvalueontheYaxisdensity=gaussian_kde(data)density.covariance_factor=lambda:.25density._

转载请注明:http://www.sonphie.com/jbzl/14208.html

  • 上一篇文章:
  • 下一篇文章:
  • 网站简介| 发布优势| 服务条款| 隐私保护| 广告合作| 网站地图| 版权申明

    当前时间: