The idea seems to have originated first(?) in Visual Statistics Book by Young and Vaeiro-Mora.
The idea is pretty simple: Overlay histograms of different widhts, in a way averaging them. The density is then gauged by the degree of "darkness" of the shade. Higher the density, higher is the shade at that point.
%pylab inline
import seaborn as sns
Populating the interactive namespace from numpy and matplotlib
x = np.random.normal(loc=3, scale=1, size=1000)
y = np.random.normal(loc=10, scale=1, size=1000)
z = np.concatenate([x, y])
sns.kdeplot(z)
<matplotlib.axes._subplots.AxesSubplot at 0x7fec3ad26f60>
fig, ax = plt.subplots()
for n_bins in range(10, 50):
n, bins, patches = ax.hist(z, n_bins,
histtype = 'step',
fill = 'green',
density=1,
facecolor='green',
alpha=0.1,
color='green')