Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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()
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #seaborn #bar #plot #dataset
ADD COMMENT
Topic
Name
9+7 =