Skip to content

Seaborn Heatmap

mosesnegus edited this page Feb 21, 2018 · 1 revision

seaborn.heatmap

The heatmap is nice. It creates a great Visual representation of our data.

Source: https://seaborn.pydata.org/generated/seaborn.heatmap.html

Example code:

import numpy as np; np.random.seed(0)
import seaborn as sns; sns.set()
uniform_data = np.random.rand(10, 12)
ax = sns.heatmap(uniform_data)

alt text

ax = sns.heatmap(uniform_data, vmin=0, vmax=1)

alt text

normal_data = np.random.randn(10, 12)
ax = sns.heatmap(normal_data, center=0)

alt text

flights = sns.load_dataset("flights")
flights = flights.pivot("month", "year", "passengers")
ax = sns.heatmap(flights)

alt text

Clone this wiki locally