Created
August 27, 2013 20:58
-
-
Save Quebecisnice/6359074 to your computer and use it in GitHub Desktop.
Generating a simple heatmap w/ python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from pandas import * | |
import matplotlib.pyplot as plt | |
Index = ['aaa', 'bbb', 'ccc', 'ddd', 'eee'] | |
Cols = ['A', 'B', 'C', 'D'] | |
df = DataFrame(abs(np.random.randn(5,4)), index=Index, columns = Cols) | |
plt.pcolor(df) | |
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment