def work_grid(grid, fig):
    """Take a two dimensional grid, add subplots to a figure for each cell and do layer work.

    Parameters:
    -----------
    grid: a two dimensional grid of layers
    fig: matplotlib figure to draw on

    Returns:
    --------
    axes: a two dimensional list of matplotlib axes
    """
    nrows = len(grid)
    ncols = len(grid[0])
    axes = [[None for _ in range(ncols)] for _ in range(nrows)]
    for row in range(nrows):
        for col in range(ncols):
            axes[row][col] = fig.add_subplot(nrows, ncols, ncols * row + col + 1)
            grid[row][col].work(ax=axes[row][col])
    return axes