Heat maps communicate succinctly how the distribution of a value evolves over time. Performance metrics like latency or API response time often have a complicated multimodal distributions, and summarizing them in single values like mean or 90th percentile for a visualization makes many interesting events invisible. You need to look at histograms to see the full distribution, and that’s exactly what heat maps are: histograms, plotted over time, with color intensity signalling frequency.
Let’s see how we can use Pandas and Seaborn Python libraries to plot a heat map from a time series.
Let’s start by importing the usual suspects:
import pandas as pd
import numpy as np
import seaborn as sns
Now let’s create a data series with some random data for the demo. Here you would substitute your own data source. This simulates taking 600000 samples at a frequency of 10ms.
observations = np.random.lognormal(3, 1, 600000)
datetimes = pd.date_range(start='now', periods=600000, freq='10ms')
series = pd.Series(observations, index=datetimes)
Before going any further, let’s plot a histogram to see what the overall distribution looks like:

What we’ll want to do is visualize the histogram of 1 minute intervals. For that we’ll use the resample method, and apply the np.histogram function:
def histogrammer(series):
return np.histogram(series, range=(0,100), bins=100)[0]
resampled = series.resample('1min').apply(histogrammer)
If you look at the resampled series, it’s a series where each observation is a histogram, an array of values. Let’s convert it into a data frame. The new data frame will have 100 columns, each corresponding to a bucket in the histogram, and one row per minute of observations.
minutely = pd.DataFrame(resampled.values.tolist(), index=resampled.index)
We can now plot the data with seaborn.heatmap.
sns.heatmap(minutely, robust=True, cmap='YlGnBu', yticklabels=False, xticklabels=5, cbar=False)
The heat map we generated by sampling the lognormal distribution is not very interesting, but if you apply the technique to your own data you’re bound to find interesting and unexplained behavior.

Real-life latency data 
Heat map from lognormal distribution
See also
Brendan Gregg’s page on using heat maps for data visualization