MatPlotlib--Lines,bars and markers--Broken Barh破损条形图

Broken Barh破损条形图

import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.broken_barh([(110, 30), (150, 10)], (10, 9), facecolors='blue')
ax.broken_barh([(10, 50), (100, 20), (130, 10)], (20, 9),
               facecolors=('red', 'yellow', 'green'))
ax.set_ylim(5, 35)
ax.set_xlim(0, 200)
ax.set_xlabel('seconds since start')
ax.set_yticks([15, 25])
ax.set_yticklabels(['Bill', 'Jim'])
ax.grid(True)
ax.annotate('race interrupted', (61, 25),
            xytext=(0.8, 0.9), textcoords='axes fraction',
            arrowprops=dict(facecolor='black', shrink=0.05),
            fontsize=16,
            horizontalalignment='right', verticalalignment='top')

plt.show()

 

broken_barh:方括号里,小括号里,第一个数字是起点位置,第二个数字是长度。

非方括号的小括号:

facecolors:条形的颜色。

set_ylim:

set_xlim:x轴的长度?

set_xlabel:X轴的标签名称

set_yticks:

set_yticklabels:

grid

annotate

不存在:

Horizontal bar chart

等待:

Plotting categorical variables

Plotting the coherence

CSD Demo

Errorbar limit selection

Errorbar Subsample

EventCollection Demo

Eventplot Demo

Filled ploygon

Filling the area between

FillBetweenx Demo

Hatch-filled histograms

Bar chart with gradients

Discrete distribution as horizontal bar chart

Join styles and cap styles

Customizing dashed line styles

Linestyles

Marker filling-styles

Marker Reference

Markevery Demo

prop_cycle property markevery in reParams

Masked Demo

Multicolored lines

Nan Test

Psd Demo

Scatter Custom Symbol

Scatter Demo2

Scatter plot with histograms

Scatter Masked

Scatter plot with pie chart markers

Scatter Star Poly

Scatter Symbol

Scatter plots with legend

Simple Plot

Using span_where

Spectrum Representations

Stackplot Demo

Stem Plot

Step Demo

Creating a timeline with lines, dates and text

hlines and vlines

Cross- and Auto- Correlation Demo

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值