xxxxxxxxxx
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
# Create containers for Subplots
fig, (ax0, ax1) = plt.subplots(nrows=1, ncols=2,
sharey=True, figsize=(7,4))
# Put plots into containers
sns.histplot(df['col1'], stat='density', ax=ax0)
sns.histplot(df['col2'], stat='density', ax=ax1)
ax1.set(xlabel="X axis label", ylabel="Y axis label", xlim=(0, 50000),
title="Some title")
ax1.axvline(x=20000, label='Vertical legend', linestyle='--')
ax1.legend()
xxxxxxxxxx
import seaborn as sns
g = sns.(yourplot)
# See what type of plot object it is
print(type(g))
# if g is FacetGrid object (it has the ability to create subplots)
# Add title to plot
g.fig.suptitle("Title", y=1.03)
# Add title to subplots
g.set_titles("This is {col_name}") # Make sure col attribute is defined in g
# if g is AxesSubplot object (it has the ability to create single plot)
# Add title to plot
g.set_title("Title", y=1.03)
# Add axis labels
g.set(xlabel="New X Label", ylabel="New Y Label")
# Rotate axis ticks
plt.xticks(rotation=90)