Skip to content

Instantly share code, notes, and snippets.

@bkamapantula
Last active April 1, 2016 23:19
Show Gist options
  • Save bkamapantula/a48ee00a3f0239d067bec360f19c1430 to your computer and use it in GitHub Desktop.
Save bkamapantula/a48ee00a3f0239d067bec360f19c1430 to your computer and use it in GitHub Desktop.
Heatmap of pandas dataframe in using matplotlib - notebook
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
# %matplotlib inline
mpl.style.use('ggplot')
df = pd.read_csv("chr_19_H2BK12ac_result.txt", sep="\t")
plt.pcolor(df[['run_1', 'run_2', 'run_3', 'run_4', 'run_5']], cmap='RdBu', norm=mpl.colors.LogNorm())
plt.colorbar()
plt.xlabel('Runs at different read lengths')
plt.ylabel('Chr 19 regions')
#labels = ['30', '30', '30', '36', '36']
#ax.set_xticklabels(labels)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment