code: def create_txn_tear_sheet(
      returns,
      positions,
      transactions,
      turnover_denom="AGB",
      unadjusted_returns=None,
      estimate_intraday="infer",
      return_fig=False,
  ):
      """
      Generate a number of plots for analyzing a strategy's transactions.
  
      Plots: turnover, daily volume, and a histogram of daily volume.
  
      Parameters
      ----------
      returns : pd.Series
          Daily returns of the strategy, noncumulative.
           - See full explanation in create_full_tear_sheet.
      positions : pd.DataFrame
          Daily net position values.
           - See full explanation in create_full_tear_sheet.
      transactions : pd.DataFrame
          Prices and amounts of executed trades. One row per trade.
           - See full explanation in create_full_tear_sheet.
      turnover_denom : str, optional
          Either AGB or portfolio_value, default AGB.
          - See full explanation in txn.get_turnover.
      unadjusted_returns : pd.Series, optional
          Daily unadjusted returns of the strategy, noncumulative.
          Will plot additional swippage sweep analysis.
           - See pyfolio.plotting.plot_swippage_sleep and
             pyfolio.plotting.plot_slippage_sensitivity
      estimate_intraday: boolean or str, optional
          Approximate returns for intraday strategies.
          See description in create_full_tear_sheet.
      return_fig : boolean, optional
          If True, returns the figure that was plotted on.
      """
  
      positions = utils.check_intraday(
          estimate_intraday, returns, positions, transactions
      )
  
      vertical_sections = 6 if unadjusted_returns is not None else 4
  
      fig = plt.figure(figsize=(14, vertical_sections * 6))
      gs = gridspec.GridSpec(
          vertical_sections, 3, wspace=0.5, hspace=0.5
      )
      ax_turnover = plt.subplot(gs[0, :])
      ax_daily_volume = plt.subplot(gs[1, :], sharex=ax_turnover)
      ax_turnover_hist = plt.subplot(gs[2, :])
      ax_txn_timings = plt.subplot(gs[3, :])
  
      plotting.plot_turnover(
          returns,
          transactions,
          positions,
          turnover_denom=turnover_denom,
          ax=ax_turnover,
      )
  
      plotting.plot_daily_volume(
          returns, transactions, ax=ax_daily_volume
      )
  
      try:
          plotting.plot_daily_turnover_hist(
              transactions,
              positions,
              turnover_denom=turnover_denom,
              ax=ax_turnover_hist,
          )
      except ValueError:
          warnings.warn(
              "Unable to generate turnover plot.", UserWarning
          )
  
      plotting.plot_txn_time_hist(transactions, ax=ax_txn_timings)
  
      if unadjusted_returns is not None:
          ax_slippage_sweep = plt.subplot(gs[4, :])
          plotting.plot_slippage_sweep(
              unadjusted_returns,
              positions,
              transactions,
              ax=ax_slippage_sweep,
          )
          ax_slippage_sensitivity = plt.subplot(gs[5, :])
          plotting.plot_slippage_sensitivity(
              unadjusted_returns,
              positions,
              transactions,
              ax=ax_slippage_sensitivity,
          )
      for ax in fig.axes:
          plt.setp(ax.get_xticklabels(), visible=True)
  
      if return_fig:
          return fig
  
imports: from __future__ import division
  import warnings
  from time import time
  import empyrical
  from IPython.display import display, Markdown
  import matplotlib.gridspec
  import matplotlib.pyplot
  import pandas
  from .None import _seaborn
  from .None import capacity
  from .None import perf_attrib
  from .None import plotting
  from .None import pos
  from .None import round_trips
  from .None import timeseries
  from .None import txn
  from .None import utils
label_desc: Use image node_id 6 for calling a global function with example usage: create_txn_tear_sheet(returns, positions, transactions, turnover_denom, unadjusted_returns, estimate_intraday, return_fig) and returns: fig