结合plotnine和dppd
dppd-plotnine的Python项目详细描述
DPPD图9
Build status: | |
---|---|
Documentation | https://dppd_plotnine.readthedocs.io/en/latest/ |
dppd_plotnine结合了 plotnine和 dppd
它允许您使用这样的代码
importnumpyasnpfromdppdimportdppdimportdppd_plotninefromplotnine.dataimportmtcarsimportplotnineasp9dp,X=dppd()plot=(dp(mtcars).assign(kwh=X.hp*0.74).categorize("cyl").p9().add_point("cyl","kwh",color="cyl",position=p9.position_jitter(height=0,random_state=500),).add_errorbar(x="cyl",y="kwh_median",ymin="kwh_median",ymax="kwh_median",data=dp(X.data).groupby("cyl").summarize(("kwh",np.median,"kwh_median")).pd,).scale_color_manual(["red","blue","purple"])# after pd, X is what it was before.pd)plot.save("test.png")
请参阅https://dppd_plotnine.readthedocs.io/en/latest/上的完整文档 有关可用的直接和增强的plotnine映射的详细信息。