Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

How to Add a Title to Seaborn Plots

# import pandas library
import pandas as pd
from pyparsing import line
import seaborn as sns
import matplotlib.pyplot as plt

# create pandas DataFrame
df = pd.DataFrame({'team': ['India', 'South Africa', 'New Zealand', 'England'],
                   'points': [10, 8, 3, 5],
                   'runrate': [0.5, 1.4, 2, -0.6],
                   'wins': [5, 4, 2, 2]})

# plot the data frame
line_plt = sns.lineplot(data = df)
line_plt.set(title = "ICC World Cup Standings")
plt.show()
Comment

add title to relplot seaborn

g = sns.relplot(x="total_bill", y="tip", hue="day", data=df)
g.fig.suptitle('Col1 x Col2', fontsize=16)
g.fig.subplots_adjust(top=0.9);
Comment

PREVIOUS NEXT
Code Example
Python :: find optimal number of clusters sklearn 
Python :: Format UTC to local timezone using PYTZ for Django 
Python :: how to extract field values in list from queryset in django 
Python :: python access key in dictionary 
Python :: python 2.7 datetime to timestamp 
Python :: max of double array python 
Python :: how to iterate over a list in python 
Python :: timedelta python 
Python :: while activating env show error of unautorize access in vscode 
Python :: find element in list that matches a condition 
Python :: create button in pyqt 
Python :: python opencv measure distance two shapes 
Python :: install python 3.8 on wsl 
Python :: remove column by index 
Python :: reset index in pandas 
Python :: python list directories only 
Python :: python node class 
Python :: iterate through directories in python 
Python :: how to reference variable in another file python 
Python :: ram clear in python 
Python :: stutter function in python 
Python :: _set in django 
Python :: find word position in string python 
Python :: python pretty print list of tuples 
Python :: install poetry on linux 
Python :: insert list python 
Python :: odoo order by xml rpc 
Python :: pandas loc for list 
Python :: input function in python 
Python :: python flask windows 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =