code: def analyze(context=None, results=None):
      # Plot the portfolio and asset data.
      ax1 = plt.subplot(611)
      results[["portfolio_value"]].plot(ax=ax1)
      ax1.set_ylabel("Portfolio\nValue\n(USD)")
  
      ax2 = plt.subplot(612, sharex=ax1)
      ax2.set_ylabel("{asset}\n(USD)".format(asset=context.ASSET_NAME))
      results[["price"]].plot(ax=ax2)
  
      trans = results.ix[[t != [] for t in results.transactions]]
      buys = trans.ix[[t[0]["amount"] > 0 for t in trans.transactions]]
      ax2.scatter(
          buys.index.to_pydatetime(),
          results.price[buys.index],
          marker="^",
          s=100,
          c="g",
          label="",
      )
  
      ax3 = plt.subplot(613, sharex=ax1)
      results[["leverage", "alpha", "beta"]].plot(ax=ax3)
      ax3.set_ylabel("Leverage ")
  
      ax4 = plt.subplot(614, sharex=ax1)
      results[["starting_cash", "cash"]].plot(ax=ax4)
      ax4.set_ylabel("Cash (USD)")
  
      results[
          [
              "treasury",
              "algorithm",
              "benchmark",
          ]
      ] = results[
          [
              "treasury_period_return",
              "algorithm_period_return",
              "benchmark_period_return",
          ]
      ]
  
      ax5 = plt.subplot(615, sharex=ax1)
      results[
          [
              "treasury",
              "algorithm",
              "benchmark",
          ]
      ].plot(ax=ax5)
      ax5.set_ylabel("Percent\nChange")
  
      ax6 = plt.subplot(616, sharex=ax1)
      results[["volume"]].plot(ax=ax6)
      ax6.set_ylabel("Volume")
  
      plt.legend(loc=3)
  
      # Show the plot.
      plt.gcf().set_size_inches(18, 8)
      plt.show()
  
imports: import pandas
  import matplotlib.pyplot
  from catalyst import run_algorithm
  from catalyst.api import order_target_value, symbol, record, cancel_order, get_open_orders
label_desc: Use image node_id 3 for calling a global function with example usage: analyze(context, results) without return types