python matplotlib bar图怎么画出这样的区间
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python matplotlib bar图怎么画出这样的区间相关的知识,希望对你有一定的参考价值。
请问怎么在条形图上画出来图例中的“工”字
# coding: utf-8import matplotlib.pyplot as pltimport numpy as np
x = np.random.randint(0, 10, size=10)
y = np.random.randint(100, 1000, size=10)
plt.bar(x, y)
plt.show() 参考技术B plt.bar(x, y, yerr=[0.1,0.1,0.2,0.2,0.2], capsize=5)
plt.show()
这个工是误差棒,由yerr决定长度,两横的长度由capsize决定
matplotlib 网格线不要覆盖柱状图
以上是关于python matplotlib bar图怎么画出这样的区间的主要内容,如果未能解决你的问题,请参考以下文章