Skip to content

Python code snippet – How to plotting horizontal bar on matplotlib?

import matplotlib.pyplot as plt 

data = [5., 25., 50., 20.]
plt.barh(range(len(data)), data)
plt.show()
See also  Python code snippet - How to add a new key to a dictionary?
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.