import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style="whitegrid", color_codes=True)
sns.set(font_scale=1)
# Collect Figure
g = sns.FUNCTION_PLOT() # for example: sns.heatmap()
fig = g.fig
# Set Title
plt.subplots_adjust(top=0.90)
g.fig.suptitle('THIS IS A TITLE, YOU BET',fontsize=16)
## HEAT MAP - Correlation
# data (df)
corr=DATA[['var1','var2','var3','var4','var5','var6']].corr()
# plot
sns.heatmap(corr,vmin=0.,vmax=1., square=True, annot=True, linewidths=.5, cmap='jet')
plt.title('Correlation between variables')
plt.show()
## SCATTER + HISTOGRAMS (x, y)
sns.jointplot(x,y,color='gold',size=10, kind="reg"))
plt.show()
## SCATTER (x,y) where x is categorical
sns.stripplot(x=datax, y=datay,jitter=True)
plt.show()
## Histogram with fitted line
sns.distplot(data)
plt.show()
## PLOT of variables (x,y) for several categorical variable z
sns.factorplot("varx","vary",data=DF,hue="varz")
plt.show()
## BOXPLOT
sns.boxplot(data,color='r')
plt.show()
## GROUPED BOXPLOT
sns.boxplot(x='colx', y='coly', data=df)
## BARPLOT with std bar error
sns.barplot(x,y)
plt.show()
## COUNT categorical observations and display by BARplotS
sns.countplot(x = 'var cat x', data = DF)
plt.show()
## PLOT per any label in different charts
g = sns.FacetGrid(DF, col="per_this_column",col_wrap=2,size = 5,xlim=(0,70),ylim=(0.,12.))
g = g.map(plt.bar, "column_x", "column_y", edgecolor="w") ## BAR CHART
g = g.map(plt.scatter, "column_x", "column_y", edgecolor="w") ## SCATTER PLOT
## BAR CHART OF COUNT categorical values of any variable
sns.countplot(x='cat_var',data=df, palette='hls')
## close figure
sns.reset_orig()