import numpy as np import matplotlib.pyplot as plt arr=np.arange(100).reshape((10,10)) plt.close('all') fig=plt.figure(figsize=(5,4)) ax=plt.subplot(111) im=ax.imshow(arr,interpolation="none") plt.tight_layout()