docs: def nodal_production_balance(
          network, 
          snapshot='all', 
          scaling=0.00001, 
          filename=None):
      """
      Plots the nodal difference between generation and consumption.
      
      Parameters
      ----------
      network : PyPSA network container
          Holds topology of grid including results from powerflow analysis
      snapshot : int or 'all'
          Snapshot to plot.
          default 'all'
      scaling : int
          Scaling to change plot sizes.
          default 0.0001
      filename : path to folder
      
      """
      fig, ax = plt.subplots(1, 1)
      gen = network.generators_t.p.groupby(network.generators.bus, axis=1).sum()
      load = network.loads_t.p.groupby(network.loads.bus, axis=1).sum()
      
      if snapshot == 'all':
          diff = (gen - load).sum()
      else:
          timestep = network.snapshots[snapshot]
          diff = (gen - load).loc[timestep]
      
      colors = {s[0]: 'green' if s[1] > 0 else 'red' 
                    for s in diff.iteritems()}
      subcolors = {'Net Consumer': 'red', 'Net Producer': 'green'}
      diff = diff.abs()
      network.plot(
              bus_sizes=diff * scaling,
              bus_colors=colors,
              line_widths=0.2,
              margin=0.01,
              ax=ax)
      
      patchList = []
      for key in subcolors:
          data_key = mpatches.Patch(color=subcolors[key], label=key)
          patchList.append(data_key)
  
      ax.legend(handles=patchList, loc='upper left')
      ax.autoscale()
      if filename:
          plt.savefig(filename)
          plt.close()
          
      return