code: def add_sizebar(ax, size):
      asb = AnchoredSizeBar(
          ax.transData,
          size,
          str(size),
          loc=8,
          pad=0.1,
          borderpad=0.5,
          sep=5,
          frameon=False,
      )
      ax.add_artist(asb)
  
imports: import matplotlib.pyplot
  import numpy
  from matplotlib import cbook
  from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
  from mpl_toolkits.axes_grid1.inset_locator import mark_inset, zoomed_inset_axes
label_desc: Use image node_id 1 for calling a global function with example usage: add_sizebar(ax, size) without return types