import matplotlib.pyplot as plt # Use plot_grid(colleges_flipped) in your code! def plot_grid(img): M = img.shape[0] N = img.shape[1] scale = 22 # Plot the horizontal grid lines for k in range(1, M, scale): x = [1, N] y = [k, k] plt.plot(x, y, color='w', linewidth=1) plt.plot(x, y, color='k', linewidth=1) # Plot the vertical grid lines for k in range(1, N, 22): x = [k, k] y = [1, M] plt.plot(x, y, color='w', linewidth=1) plt.plot(x, y, color='k', linewidth=1) # Set axis limits plt.xlim(1, N) plt.ylim(1, M) plt.show()