Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

matplotlib change bar color under threshold

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()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #matplotlib #change #bar #color #threshold
ADD COMMENT
Topic
Name
1+3 =