how to plotting horizontal bar on matplotlib

Do you want to know the details regarding “how to plotting horizontal bar on matplotlib”. If yes, you’re in the correct tutorial.

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()

Final Thoughts

I hope this tutorial helps you to know about “how to plotting horizontal bar on matplotlib”. If you have any doubts regarding this post please let us know via the comment section. Share this tutorial with your friends and family via social networks.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coder Diksha. Here, I post about programming to help developers.

Share on:

Leave a Comment