code: def set_figure_artist_positions(
      pack: LayoutPack,
      tparams: TightParams,
  ):
      """
      Set the x,y position of the artists around the panels
      """
      _property = pack.theme.themeables.property
      spaces = tparams.spaces
      grid = tparams.grid
  
      if pack.plot_title:
          try:
              ha = _property("plot_title", "ha")
          except KeyError:
              ha = "center"
          pack.plot_title.set_y(spaces.t.edge("plot_title"))
          horizonally_align_text_with_panels(pack.plot_title, grid, ha)
  
      if pack.plot_subtitle:
          try:
              ha = _property("plot_subtitle", "ha")
          except KeyError:
              ha = "center"
          pack.plot_subtitle.set_y(spaces.t.edge("plot_subtitle"))
          horizonally_align_text_with_panels(
              pack.plot_subtitle, grid, ha
          )
  
      if pack.plot_caption:
          try:
              ha = _property("plot_caption", "ha")
          except KeyError:
              ha = "right"
          pack.plot_caption.set_y(spaces.b.edge("plot_caption"))
          horizonally_align_text_with_panels(
              pack.plot_caption, grid, ha
          )
  
      if pack.axis_title_x:
          try:
              ha = _property("axis_title_x", "ha")
          except KeyError:
              ha = "center"
          pack.axis_title_x.set_y(spaces.b.edge("axis_title_x"))
          horizonally_align_text_with_panels(
              pack.axis_title_x, grid, ha
          )
  
      if pack.axis_title_y:
          try:
              va = _property("axis_title_y", "va")
          except KeyError:
              va = "center"
          pack.axis_title_y.set_x(spaces.l.edge("axis_title_y"))
          vertically_align_text_with_panels(pack.axis_title_y, grid, va)
  
      if pack.legend and pack.legend_position:
          set_legend_position(
              pack.legend, pack.legend_position, tparams, pack.figure
          )
  
file_path: plotnine/plotnine/_mpl/_plotnine_tight_layout.py
imports: from __future__ import annotations
  import typing
  from copy import deepcopy
  from dataclasses import dataclass
  from matplotlib.offsetbox import AnchoredOffsetbox
  from ._plot_side_space import LRTBSpaces, WHSpaceParts, calculate_panel_spacing
label_desc: Use image node_id 2 for calling a global function with example usage: set_figure_artist_positions(pack, tparams) without return types