# Visualizing a matrix with imshow

The following code compares two interpolation schemes, 'bilinear' (which, for a small array will make a blurry image) and 'nearest' which should look "blocky" (i.e. more faithful to the data).

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm

# Make an array with ones in the shape of an 'X'
a = np.eye(10,10)
a += a[::-1,:]

fig = plt.figure()

Note: in earlier versions of Matplotlib, bilinear interpolation was the default and interpolation='nearest' had to be set explicitly if required.