Below code plots a heatmap from a matrix, but it returns an image. I want a figure to be returned. Please let me know how would i achieve it.
from numpy.matlib import rand
from pylab import *
import matplotlib.pyplot as plt
A = []
i = input('Enter number of rows: ')
j = input('Enter number of columns: ')
for x in range(i):
row = []
for y in range(j):
k = input('enter the value: ')
row.append(k)
A.append(row)
print A
figure(2)
plt.imshow(A, aspect=(0.1), interpolation='nearest', origin='lower', extent=(0, 10, 0, 100))
plt.grid(True)
plt.xlabel('abc', fontsize=15)
plt.ylabel('xyz', fontsize=15)
plt.show()