I have been trying this for several hours now.
I am essentially trying to get the scales of the colorbars to be the same.
I picked up this example from a previous post in which one suggestion was to use the kwargs = {'levels': np.arange(0, 0.15, 0.01)} line. I have included it, but I have not seen any changes, the scales remain the same.
This is the code that I am using:
import numpy as np
import seaborn as sns
import pandas
import matplotlib.pyplot as plt
from matplotlib import rcParams
np.random.seed(10)
sns.set(color_codes=True)
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = ['Arial']
plt.ioff()
kwargs = {'levels': np.arange(0, 0.15, 0.01)} #trying to get the colorbar scales to be the same
f, ax = plt.subplots(figsize=(7, 5))
ax.tick_params(axis='both', which='major', labelsize=22)
mean, cov = [0, 2], [(2, 1), (.5, 1)]
x1, y1 = np.random.multivariate_normal(mean, cov, size=50).T
mean, cov = [5, 7], [(3, 2), (7, 1)]
x2, y2 = np.random.multivariate_normal(mean, cov, size=50).T
sns.kdeplot(x1, y1, cmap="Reds", shade=True, shade_lowest=False,
alpha=0.66, legend=False, cbar=True, **kwargs, ax= ax )
sns.kdeplot(x2, y2, cmap="Greens", shade=True, shade_lowest=False, alpha=0.66,\
legend=False, cbar=True,**kwargs, ax = ax)
plt.xlabel("foo", fontsize=22)
plt.ylabel("bar", fontsize=22)

