Creating a grid viz that lights up squares from the grid

Is there a way to create a grid viz just like the one below? It can be a numpy array with ones and zeros changing over time, the array is displayed as a ‘matrix’. Notice that the viz is not an MxN matrix, the last row may contain less squares than the rest of the rows

14