Data Import

In [1]:
import matplotlib.pyplot as plt
import pandas as pd
#Please adjust to your file
df=pd.read_excel("/Users/davidmika/Desktop/First.xlsx","Sheet1")

Heat Map

In [6]:
import numpy as np
data = np.random.rand(4,2)
#Define rows here
rows = list('1234')
#Define column categories here
columns = list('MF')
fig,ax=plt.subplots()
ax.pcolor(data,cmap=plt.cm.Reds,edgecolors='k')
ax.set_xticks(np.arange(0,2)+0.5)
ax.set_yticks(np.arange(0,4)+0.5)
ax.xaxis.tick_bottom()
ax.yaxis.tick_left()
ax.set_xticklabels(columns,minor=False,fontsize=20)
ax.set_yticklabels(rows,minor=False,fontsize=20)
#Show heat map
plt.show()
In [ ]: