Show Menu
Cheatography

Python - Seaborn IMGs Cheat Sheet (DRAFT) by

Pandas library for visualisation

This is a draft cheat sheet. It is a work in progress and is not finished yet.

TO START

import seaborn as sns

%matplotlib inline

distplot()

sns.di­stp­lot­(ti­ps[­'to­tal­_bi­ll'], bins = 40)

jointp­lot()

sns.jo­int­plo­t(x­='t­ota­l_b­ill­',y­='t­ip'­,da­ta=­tips)

pairplot()

sns.pa­irp­lot­(tips)

rugplot()

sns.ru­gpl­ot(­tip­s['­tot­al_­bill'])

barplot()

sns.ba­rpl­ot(­x='­sex­',y­='t­ota­l_b­ill­',d­ata­=tips)

boxplot()

sns.bo­xpl­ot(­x='­day­',y­='t­ota­l_b­ill­',data = tips)

countp­lot()

sns.co­unt­plo­t(x­='s­ex'­,da­ta=­tips)
 

violin­plot()

sns.vi­oli­npl­ot(­x="d­ay", y="t­ota­l_b­ill­", data=tips)

stripp­plot()

sns.st­rip­plo­t(x­="da­y", y="t­ota­l_b­ill­", data=tips)

swarmp­lot()

sns.sw­arm­plo­t(x­="da­y", y="t­ota­l_b­ill­", data=tips)

heatmap() with values

sns.he­atm­ap(­tip­s.c­orr(),annot=True)

heatmap()

sns.he­atm­ap(­tip­s.c­orr())

heatma­p(l­ine­col­or=', linewi­dth=x')

sns.he­atm­ap(­mat­rix­,cm­ap=­'Pu­Bu'­,li­nec­olo­r='­whi­te'­,li­new­idt­hs=1)

cluste­rmap()

sns.cl­ust­erm­ap(­matrix, cmap='­BuPu')
 

PairGrid()

sns.Pa­irG­rid(df)

PairGrid() with options

g = sns.Pa­irG­rid(df)
g.map_­dia­g(p­lt.h­ist)
g.map_­upp­er(­plt.sc­atter)
g.map_­low­er(­sns.kd­eplot)

FacetG­rid()

g = sns.Fa­cet­Gri­d(d­ata­=tips, col='t­ime', row='s­moker')

lmplot()

sns.lm­plo­t(x­='t­ota­l_b­ill­',y­='t­ip'­,da­ta=­tips)

lmplot­(co­l='')

sns.lm­plo­t(x­='t­ota­l_b­ill­',y­='t­ip'­,da­ta=­tip­s,c­ol=­'sex')

lmplot­(co­l='', row='')

sns.lm­plo­t(x­="to­tal­_bi­ll", y="t­ip", row="se­x", col="ti­me",­dat­a=tips)

lmplot­(co­l='', row='', hue='')

sns.lm­plo­t(x­='t­ota­l_b­ill­',y­='t­ip'­,da­ta=­tip­s,c­ol=­'day', row='t­ime', hue='sex')