code: def horizonally_align_text_with_panels(
      text: Text, grid: GridSpecParams, ha: str
  ):
      """
      Horizontal justification
  
      Reinterpret horizontal alignment to be justification about the panels.
      """
      if ha == "center":
          text.set_x((grid.left + grid.right) / 2)
      elif ha == "left":
          text.set_x(grid.left)
      elif ha == "right":
          text.set_x(grid.right)
  
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 3 for calling a global function with example usage: horizonally_align_text_with_panels(text, grid, ha) without return types