Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

bar chart with seaborn

import seaborn as sns
import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(10,10))
# x and y are lists
sns.barplot(x=x, y=y, color='goldenrod', ax=ax, label="Some Label")
ax.set_xlabel("X-Label")
ax.set_ylabel("Y-Label")
ax.legend()
plt.show()
Comment

seaborn bar plot dataset

# importing the required library
import seaborn as sns
import matplotlib.pyplot as plt
 
# read a titanic.csv file
# from seaborn library
df = sns.load_dataset('titanic')
 
# class v / s fare barplot
sns.barplot(x = 'class', y = 'fare', hue = 'sex', data = df)
 
# Show the plot
plt.show()
Comment

seaborn bar plot

# importing the required library
import seaborn as sns
import matplotlib.pyplot as plt
 
# read a titanic.csv file
# from seaborn library
df = sns.load_dataset('titanic')
 
# class v / s fare barplot
sns.barplot(x = 'class', y = 'fare', data = df)
 
# Show the plot
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: python merge lists 
Python :: python pop element 
Python :: tf-idf python implementation 
Python :: dynamic array python numpy 
Python :: make a window tkinter 
Python :: random string generate python of 2.7 
Python :: pandas get day names 
Python :: how to get dummies in a dataframe pandas 
Python :: python kivy 
Python :: pandas select 2nd row 
Python :: python push to list 
Python :: calculate days between two dates python 
Python :: converting decimal to hex in python 
Python :: palindrome string python 
Python :: http server 
Python :: python insertion sort 
Python :: python remove punctuation from text file 
Python :: np.random 
Python :: change matplotlib fontsize 
Python :: number of words in a string python 
Python :: python how to count number of true 
Python :: error command errored out with exit status 1 face_recognition 
Python :: matplotlib measure the width of text 
Python :: how to do a foreach loop in python 
Python :: remove duplicate columns python dataframe 
Python :: operator precedence in python 
Python :: how to take input in python3 separated by space 
Python :: how to merge two dictionaries 
Python :: python pdf fpdf example 
Python :: detect operating system using python 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =