The imshow() function with parameters interpolation='nearest' and cmap='hot' should do what you want.
Please review the interpolation parameter details, and see Interpolations for imshow and Image antialiasing.
import matplotlib.pyplot as plt
import numpy as np
a = np.random.random((16, 16))
plt.imshow(a, cmap='hot', interpolation='nearest')
plt.show()

The imshow() function with parameters interpolation='nearest' and cmap='hot' should do what you want.
Please review the interpolation parameter details, and see Interpolations for imshow and Image antialiasing.
import matplotlib.pyplot as plt
import numpy as np
a = np.random.random((16, 16))
plt.imshow(a, cmap='hot', interpolation='nearest')
plt.show()

Seaborn is a high-level API for matplotlib, which takes care of a lot of the manual work.
seaborn.heatmap automatically plots a gradient at the side of the chart etc.
import numpy as np
import seaborn as sns
import matplotlib.pylab as plt
uniform_data = np.random.rand(10, 12)
ax = sns.heatmap(uniform_data, linewidth=0.5)
plt.show()

You can even plot upper / lower left / right triangles of square matrices. For example, a correlation matrix, which is square and is symmetric, so plotting all values would be redundant.
corr = np.corrcoef(np.random.randn(10, 200))
mask = np.zeros_like(corr)
mask[np.triu_indices_from(mask)] = True
with sns.axes_style("white"):
ax = sns.heatmap(corr, mask=mask, vmax=.3, square=True, cmap="YlGnBu")
plt.show()

Look like you use pandas dataframe. Before plotting pivot dataframe to be a table and use heatmap method, i.e. from seaborn:
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_clipboard()
table = df.pivot('Y', 'X', 'Value')
ax = sns.heatmap(table)
ax.invert_yaxis()
print(table)
plt.show()

Output:
X 0 1
Y
1 0.6 0.8
2 0.3 0.4
3 0.2 0.9
I'm late to the party, but here's a solution to OP's question using only matplotlib, as was requested. It relies on using imshow's extent option to do the job. For more info, see the matplotlib manual.
import matplotlib.pyplot as plt
xvals = [0,1]
yvals = [1,3]
zvals = [[0.6, 0.3, 0.2], [0.8, 0.4, 0.9]]
heatmap, ax = plt.subplots()
im = ax.imshow(zvals,cmap='inferno',extent=[xvals[0],xvals[1],yvals[0],yvals[1]],interpolation='nearest',origin='lower',aspect='auto')
ax.set(xlabel='some x', ylabel='some y')
cbar = heatmap.colorbar(im)
cbar.ax.set_ylabel('stuff')
heatmap.savefig('heatmap.png')
which results in the following image
