Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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

horizontal bar plot python

import seaborn as sns

sns.barplot(data=df, orient = 'h')
Comment

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

PREVIOUS NEXT
Code Example
Python :: athena connector python 
Python :: RuntimeWarning: invalid value encountered in true_divide 
Python :: python get angle between two points 
Python :: mount drive google colab 
Python :: install python selenium webdriver 
Python :: solve system of linear equations numpy 
Python :: get href scrapy xpath 
Python :: python remove n random elements from a list 
Python :: How to Add R to Jupyter Notebook 
Python :: run git pull from python script 
Python :: select all columns except one pandas 
Python :: print 2d array in python 
Python :: json indent options python 
Python :: sin and cos in python 
Python :: flask upload file to s3 
Python :: python selenium full screen 
Python :: check string equal with regular expression python 
Python :: django widgets 
Python :: key press python 
Python :: add element to list python at index 
Python :: base64 python decode 
Python :: python delete file with extension 
Python :: Django - include app urls 
Python :: map function using lambda in python 
Python :: tkinter starter code 
Python :: column.replace 
Python :: python copy dataframe 
Python :: how to make it so we can give unlimited parameters in python function 
Python :: make lists for each 2 items in a list 
Python :: python check if exe is running 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =