18 python数据可视化stackplot, broken_barh, step, tabel

00 载入扩展库

import numpy as np
import matplotlib.pyplot as plt

01 stackplot()

x=np.arange(1,6,1)
y=[1,3,4,2,7]
y1=[3,4,1,6,5]
plt.stackplot(x,y,y1)

18 python数据可视化stackplot, broken_barh, step, tabel的图1

02 broken_barh()

plt.broken_barh([(30,100),(180,50)],(20,8))
18 python数据可视化stackplot, broken_barh, step, tabel的图2

03 step()

x=np.linspace(1,10,10)
y=np.sin(x)

plt.step(x,y,color='r',where='pre',marker='o',mfc='k')

18 python数据可视化stackplot, broken_barh, step, tabel的图3

plt.step(x,y,color='r',where='mid',marker='^',mfc='k')

18 python数据可视化stackplot, broken_barh, step, tabel的图4

plt.step(x,y,color='r',where='post',marker='s',mfc='k')

18 python数据可视化stackplot, broken_barh, step, tabel的图5

04 tabel()

x=[40,15,20,25]
leg,label,pct=plt.pie(x,autopct='%.0f%%')

18 python数据可视化stackplot, broken_barh, step, tabel的图6

collabel=['A','C','D','E']
rowlabel=['stu']
celltext=[(200,300,380,230)]
plt.table(colLabels=collabel,colLoc='right',colWidths=[0.4]*4,
          cellText=celltext,cellLoc='center',
          rowLabels=rowlabel,loc='top')

18 python数据可视化stackplot, broken_barh, step, tabel的图7

登录后免费查看全文
立即登录
App下载
技术邻APP
工程师必备
  • 项目客服
  • 培训客服
  • 平台客服

TOP

1