code: def plot_sector_allocations(returns, sector_alloc, ax=None, **kwargs):
      
  
      if ax is None:
          ax = plt.gca()
  
      sector_alloc.plot(title='Sector allocation over time',
                        alpha=0.5, ax=ax, **kwargs)
  
      box = ax.get_position()
      ax.set_position([box.x0, box.y0 + box.height * 0.1,
                       box.width, box.height * 0.9])
  
      # Put a legend below current axis
      ax.legend(loc='upper center', frameon=True, framealpha=0.5,
                bbox_to_anchor=(0.5, -0.14), ncol=5)
  
      ax.set_xlim((sector_alloc.index[0], sector_alloc.index[-1]))
      ax.set_ylabel('Exposure by sector')
      ax.set_xlabel('')
  
      return ax
docs: Plots the sector exposures of the portfolio over time.
  
      Parameters
      ----------
      returns : pd.Series
          Daily returns of the strategy, noncumulative.
           - See full explanation in tears.create_full_tear_sheet.
      sector_alloc : pd.DataFrame
          Portfolio allocation of positions. See pos.get_sector_alloc.
      ax : matplotlib.Axes, optional
          Axes upon which to plot.
      **kwargs, optional
          Passed to plotting function.
  
      Returns
      -------
      ax : matplotlib.Axes
          The axes that were plotted on.