code: def layout_padding(plots, renderer):
      
      widths, heights = defaultdict(int), defaultdict(int)
      for r, row in enumerate(plots):
          for c, p in enumerate(row):
              if p is not None:
                  width, height = renderer.get_size(p)
                  widths[c] = max(widths[c], width)
                  heights[r] = max(heights[r], height)
  
      expanded_plots = []
      for r, row in enumerate(plots):
          expanded_plots.append([])
          for c, p in enumerate(row):
              if p is None:
                  p = empty_plot(widths[c], heights[r])
              elif hasattr(p, 'plot_width') and p.plot_width == 0 and p.plot_height == 0:
                  p.plot_width = widths[c]
                  p.plot_height = heights[r]
              expanded_plots[r].append(p)
      return expanded_plots
docs: Pads Nones in a list of lists of plots with empty plots.