In [1]:
import numpy as np
from pandas import DataFrame
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
# create a heatmap (i.e. "colorized" data table)
indexes = ['I', 'II', 'III', 'IV', 'V']
columns = ['A', 'B', 'C', 'D']
df = DataFrame(abs(np.random.randn(5, 4)), index=indexes, columns=columns)
print(df)
In [3]:
# display the heatmap with a red color palette
plt.pcolor(df, cmap=plt.cm.Reds)
plt.yticks(np.arange(0.5, len(df.index), 1), df.index)
plt.xticks(np.arange(0.5, len(df.columns), 1), df.columns)
plt.show()