code: def test_connection_patch_fig(fig_test, fig_ref):
      # Test that connection patch can be added as figure artist, and that figure
      # pixels count negative values from the top right corner (this API may be
      # changed in the future).
      ax1, ax2 = fig_test.subplots(1, 2)
      con = mpatches.ConnectionPatch(
          xyA=(0.3, 0.2),
          coordsA="data",
          axesA=ax1,
          xyB=(-30, -20),
          coordsB="figure pixels",
          arrowstyle="->",
          shrinkB=5,
      )
      fig_test.add_artist(con)
  
      ax1, ax2 = fig_ref.subplots(1, 2)
      bb = fig_ref.bbox
      # Necessary so that pixel counts match on both sides.
      plt.rcParams["savefig.dpi"] = plt.rcParams["figure.dpi"]
      con = mpatches.ConnectionPatch(
          xyA=(0.3, 0.2),
          coordsA="data",
          axesA=ax1,
          xyB=(bb.width - 30, bb.height - 20),
          coordsB="figure pixels",
          arrowstyle="->",
          shrinkB=5,
      )
      fig_ref.add_artist(con)
  
imports: import numpy
  from numpy.testing import assert_almost_equal, assert_array_equal
  import pytest
  import matplotlib
  from matplotlib.patches import Annulus, Ellipse, Patch, Polygon, Rectangle, FancyArrowPatch, FancyArrow, BoxStyle, Arc
  from matplotlib.testing.decorators import image_comparison, check_figures_equal
  from matplotlib.transforms import Bbox
  import matplotlib.pyplot
  from matplotlib import collections, colors, patches, path, transforms, rcParams
  import sys
label_desc: Use image node_id 21 for calling a global function with example usage: test_connection_patch_fig(fig_test, fig_ref) without return types