from pylab import *
import numpy as np
import matplotlib.pyplot as plt
row=int(input("Rows: "))
col=int(input("Columns: "))

M=loadtxt('sdm.dat')
plt.imshow(M, cmap='copper')
plt.colorbar()
plt.axis('off')
plt.savefig('2d.png')
'''
s=np.array(M)
count=[]
for i in range(1,row):
    for j in range(1,col):
        count.append((i,j,M[i-1][j-1]))
data=np.array(count)
top=data[:,2]
botton=np.zeros_like(data[:,2])
fig=figure(figsize=(8,8))
graf=fig.add_subplot(projection='3d')
graf.bar3d(data[:,0],data[:,1],botton,1,1,top,shade=True,cmap='copper')
graf.figure.savefig('3d.png')
'''
