Answers for "how to make horizontal bar plots in matplot lib"

2

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()
Posted by: Guest on June-13-2020
0

horizontal bar plot python

import seaborn as sns

sns.barplot(data=df, orient = 'h')
Posted by: Guest on November-08-2020
0

horizontal bar plot matplotlib

import matplotlib.pyplot as plt
   
Product = ['Computer','Monitor','Laptop','Printer','Tablet']
Quantity = [320,450,300,120,280]

plt.barh(Product,Quantity)
plt.title('Store Inventory')
plt.ylabel('Product')
plt.xlabel('Quantity')
plt.show()
Posted by: Guest on January-13-2022

Python Answers by Framework

Browse Popular Code Answers by Language