I have a nested list of dictionaries, created like this:

```
N = 30
grid = []
for row in range(N):
   rows = []
   for column in range(N):
      each_cell = {"check": 0, "type": -1}
      rows.append(each_cell)
   grid.append(rows)

```

Type is the one that I want to plot, a value of -1 means nothing in the cell, and 0,1,2,3 are different types (not gradient), which I want to be represented by different colours.

I am putting a random number of types into the grid like this:

```
import numpy.random as rnd
import matplotlib.pyplot as plt

for i in range (rnd.randint(0, N*N)):
   x = rnd.randint(0, N)
   y = rnd.randint(0, N)
   grid[x][y]['check'] = 1
   if grid[x][y]['check'] == 1:
      grid[x][y]['type'] = rnd.randint(0,4)

```

I am attempting to plot it using this:

```
plt.imshow(grid['type'], interpolation = 'nearest', cmap = 'gist_ncar_r')
plt.show()

```

But obviously the `grid['type']` isn't picking out only the types like I want it to, anybody know how to fix this?