import matplotlib.pyplot as plt
import seaborn as sns #"samuel norman seaborn" is a tv character
sns.catplot(
data=
, kind="count" #set count plot
, x= #sets horizontal axis for column chart
, x= #set horizontal axis for bar chart
, col= #names field on which to split
, row= #names field on which to split
, order= [] #this list orders categories on the horizontal axis
)
sns.catplot(
data=
, kind="bar" #set bar plot
, x= #sets horizontal axis
, y= #sets vertical axis
, col= #names field on which to split
, row= #names field on which to split
, ci=None #turns off the confident interval
)
sns.catplot(
data=
, kind="box" #set box and whiskers plot
, x= #sets horizontal axis
, y= #sets vertical axis
, order= [] #this list orders categories on the horizontal axis
, sym="" #exclude outlier spots
, whis= #changes the boxes' whiskers
, whis=0.5 #sets whiskers to 0.5 of interquartile range
, whis=[n,m] #sets whiskers to n-th and m-th percentile
, whis=[0,100] #sets whislers to min and max
, hue=
)
sns.catplot(
data=
, kind="point" #set point plot
, x= #sets horizontal axis
, y= #sets vertical axis
, hue=
, join= #turn of line between points
, estimator= #set estimator, standard is mean
, estimator=median #sets median, median needs import from numpy: from numpy import median
, capsize= #add vertical line to the confidence interval
, ci=None #turns off the confident interval
)
sns.relplot(
data = #names data frame table
, kind="scatter" #set scatter plot
, x= #sets horizontal axis
, y= #sets vertical axis
, hue= #set colour for plot dot
, hue_order=[] #list for colour
, palette={"":"","":""} #dictionary for colors by value name
, alpha=n #set transparency from 0 to 1
, col= #names field on which to split
, col_wrap=n #makes n plots per row
, col_order=[] #sets order list for columns
, row= #names field on which to split
, row_order=[] #sets order list for row
, style= #sets point style
, size= #sets point size
)
sns.relplot(
data = #names data frame table
, kind="line" #set scatter plot
, x= #sets horizontal axis
, y= #sets vertical axis
, hue= #set different line colours
, style= #set different line styles
, dashes=False #turns off dashed line styles
, markers=True #sets markers for data points
, ci= #sets confidence interval
, ci="sd" #sets confidence interval to standard deviation
, ci=None #turns off the confidence interval depiction
)
sns.scatterplot(
data= #names data frame table
, x= #sets horizontal axis
, y= #set vertical axis
, hue= #set colour for plot dot
, hue_order=[] #list for colour
, palette={"":"","":""} #dictionary for colors by value name
)
sns.countplot(
data = #names data frame table
, x= #sets horizontal axis
, hue= #set colour for plot dot
, hue_order=[] #list for colour
, palette={"":"","":""} #dictionary for colors by value name
)
fig.suptitle("My_title") #adds a title to a plot
fig.suptitle("My_title"y=n) #adds a title to a plot at position n
.set(xlabel="",ylabel="") #set labels for axes
.set_titels() #sets titels for subplots
plt.xticks(rotation=n) #rotates tick labels on the horizontal axis
sns.set_style()
sns.set_palette()
sns.set_palette(['#…','#…',…]) #adds a palette as a list of hex codes
sns.set_context() #sets size scale of plot elements
g = sns.catplot(…)
g.fig.suptitle("My_title") #to add a title to the chart g
g = sns.boxplot(…)
g.set_title("My_title") #to add a title to the chart g
g.set_titles("My group names {col_name}") #sets column's name as title