📌  相关文章
📜  matplotlib 在阈值下更改条形颜色 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:21.067000             🧑  作者: Mango

代码示例1
import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)

N = 5
ind = np.arange(N)
width = 0.5
vals = [1,2,3,4,5]
colors = ['r','b','b','b','b']
ax.barh(ind, vals, width, color=colors)

plt.show()