9951 explained code solutions for 126 technologies


python-matplotlibHow to make horizontal bar chart


import matplotlib.pyplot as plt
plt.barh(['UA', 'UK', 'USA'], [10, 11, 12])
plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

.barh

will plot horizontal bar chart

['UA', 'UK', 'USA']

vertical axis values (labels)

[10, 11, 12]

horizontal axis values

.show()

render chart in a separate window