In [4]:
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
%matplotlib
matplotlib.style.use("ggplot")


Using matplotlib backend: MacOSX

In [5]:
df = pd.DataFrame(np.random.randn(1000, 5), columns=['a', 'b', 'c', 'd', 'e'])
df.corr()


Out[5]:
a b c d e
a 1.000000 0.037434 -0.026023 -0.015054 0.002693
b 0.037434 1.000000 -0.030336 -0.018162 -0.040271
c -0.026023 -0.030336 1.000000 -0.000742 0.045151
d -0.015054 -0.018162 -0.000742 1.000000 0.004389
e 0.002693 -0.040271 0.045151 0.004389 1.000000

In [6]:
plt.imshow(df.corr(), cmap=plt.cm.Blues, interpolation="nearest")
plt.colorbar()
tick_marks = [i for i in range(len(df.columns))]
plt.xticks(tick_marks, df.columns, rotation="vertical")
plt.yticks(tick_marks, df.columns)
plt.show()

In [ ]: