code: def plot_slippage_sensitivity(returns, positions, transactions,
                                ax=None, **kwargs):
      
  
      if ax is None:
          ax = plt.gca()
  
      avg_returns_given_slippage = pd.Series()
      for bps in range(1, 100):
          adj_returns = txn.adjust_returns_for_slippage(returns, positions,
                                                        transactions, bps)
          avg_returns = ep.annual_return(adj_returns)
          avg_returns_given_slippage.loc[bps] = avg_returns
  
      avg_returns_given_slippage.plot(alpha=1.0, lw=2, ax=ax)
  
      ax.set_title('Average annual returns given additional per-dollar slippage')
      ax.set_xticks(np.arange(0, 100, 10))
      ax.set_ylabel('Average annual return')
      ax.set_xlabel('Per-dollar slippage (bps)')
  
      return ax
docs: Plots curve relating per-dollar slippage to average annual returns.
  
      Parameters
      ----------
      returns : pd.Series
          Timeseries of portfolio returns to be adjusted for various
          degrees of slippage.
      positions : pd.DataFrame
          Daily net position values.
           - See full explanation in tears.create_full_tear_sheet.
      transactions : pd.DataFrame
          Prices and amounts of executed trades. One row per trade.
           - See full explanation in tears.create_full_tear_sheet.
      ax : matplotlib.Axes, optional
          Axes upon which to plot.
      **kwargs, optional
          Passed to seaborn plotting function.
  
      Returns
      -------
      ax : matplotlib.Axes
          The axes that were plotted on.