code: def get_axis_properties(axis):
      """Return the property dictionary for a matplotlib.Axis instance"""
      props = {}
      label1On = axis._major_tick_kw.get("label1On", True)
  
      if isinstance(axis, matplotlib.axis.XAxis):
          if label1On:
              props["position"] = "bottom"
          else:
              props["position"] = "top"
      elif isinstance(axis, matplotlib.axis.YAxis):
          if label1On:
              props["position"] = "left"
          else:
              props["position"] = "right"
      else:
          raise ValueError(
              "{0} should be an Axis instance".format(axis)
          )
  
      # Use tick values if appropriate
      locator = axis.get_major_locator()
      props["nticks"] = len(locator())
      if isinstance(locator, ticker.FixedLocator):
          props["tickvalues"] = list(locator())
      else:
          props["tickvalues"] = None
  
      # Find tick formats
      formatter = axis.get_major_formatter()
      if isinstance(formatter, ticker.NullFormatter):
          props["tickformat"] = ""
      elif isinstance(formatter, ticker.FixedFormatter):
          props["tickformat"] = list(formatter.seq)
      elif not any(
          label.get_visible() for label in axis.get_ticklabels()
      ):
          props["tickformat"] = ""
      else:
          props["tickformat"] = None
  
      # Get axis scale
      props["scale"] = axis.get_scale()
  
      # Get major tick label size (assumes that's all we really care about!)
      labels = axis.get_ticklabels()
      if labels:
          props["fontsize"] = labels[0].get_fontsize()
      else:
          props["fontsize"] = None
  
      # Get associated grid
      props["grid"] = get_grid_style(axis)
  
      # get axis visibility
      props["visible"] = axis.get_visible()
  
      return props
  
imports: import itertools
  import io
  import base64
  import numpy
  import warnings
  import matplotlib
  from matplotlib.colors import colorConverter
  from matplotlib.path import Path
  from matplotlib.markers import MarkerStyle
  from matplotlib.transforms import Affine2D
  from matplotlib import ticker
label_desc: Use image node_id 9 for calling a global function with example usage: get_axis_properties(axis) and returns: props