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 glob all files in directory recursively 
Python :: No package python37 available. 
Python :: django __str__ self multiple 
Python :: filter function in pandas stack overflow 
Python :: python create list from range 
Python :: switching keys and values in a dictionary in python [duplicate] 
Python :: how to add an item to a list in python 
Python :: transpose array python 
Python :: Issue TypeError: can’t multiply sequence by non-int of type str 
Python :: isistance exmaple 
Python :: python print raw string 
Python :: get guild by id discord.py 
Python :: find common values in different dataframes pandas 
Python :: get a slice of string in python 
Python :: how to change username of a bot using discord.py 
Python :: python sort two key 
Python :: instabot python 
Python :: np to tuple 
Python :: python returen Thread 
Python :: pandas name of day 
Python :: where to find location of where python is installed linux 
Python :: permutation with repetition python 
Python :: python class variables make blobal 
Python :: run multiple function with multiprocessing python 
Python :: count occurrences of a character in a string python 
Python :: convert decimal to hex python 
Python :: dataframe from dict 
Python :: django cookies 
Python :: creating data frame in python with for loop 
Python :: python add up values in list 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =