You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
axes.bar supports values given as dict_values yet axes.barh throws an error #14693
Bug summary
Calling axes.barh will throw this error if the height of the bars are given as a dictonary values type TypeError: unsupported operand type(s) for +: 'int' and 'dict_values'
Code for reproduction
importmatplotlib.pyplotaspltdata= {'cats': 10, 'dogs': 20}
# Works as expectedfig, ax=plt.subplots(1)
ax.bar(range(len(data)), data.values())
# Doesn't workfig, ax=plt.subplots(1)
ax.barh(range(len(data)), data.values())
# Works as expectedfig, ax=plt.subplots(1)
ax.barh(range(len(data)), list(data.values()))
plt.show()
It looks like you're using an old version of Matplotlib; the most recent version is 3.1.1. Please could you upgrade to Matplotlib 3.1.1 and let us know if there is still a problem?
Activity
timhoffm commentedon Jul 4, 2019
Works on master with Python 3.7.
Please provide your python and matplotlib versions.
Dr-Hughes commentedon Jul 4, 2019
dstansby commentedon Jul 15, 2019
It looks like you're using an old version of Matplotlib; the most recent version is
3.1.1. Please could you upgrade to Matplotlib3.1.1and let us know if there is still a problem?jklymak commentedon Jul 15, 2019
Yeah this was fixed in 3.1. #13187 I'm going to close...