code: def draw_sizebar(ax):
      """
      Draw a horizontal bar with length of 0.1 in data coordinates,
      with a fixed label center-aligned underneath.
      """
      size = 0.1
      text = r"1$^{\prime}$"
      sizebar = AuxTransformBox(ax.transData)
      sizebar.add_artist(Line2D([0, size], [0, 0], color="black"))
      text = TextArea(text)
      packer = VPacker(
          children=[sizebar, text], align="center", sep=5
      )  # separation in points.
      ax.add_artist(
          AnchoredOffsetbox(
              child=packer,
              loc="lower center",
              frameon=False,
              pad=0.1,
              borderpad=0.5,
          )
      )
  
file_path: matplotlib/galleries/examples/misc/anchored_artists.py
imports: from matplotlib import pyplot
  from matplotlib.lines import Line2D
  from matplotlib.offsetbox import AnchoredOffsetbox, AuxTransformBox, DrawingArea, TextArea, VPacker
  from matplotlib.patches import Circle, Ellipse
label_desc: Use image node_id 4 for calling a global function with example usage: draw_sizebar(ax) without return types