code: def _transform_positioning(ha, va):
      
      if ha == "center" and va == "center":
          return None
  
      ha_mpl_to_tikz = {"right": "east", "left": "west", "center": ""}
      va_mpl_to_tikz = {
          "top": "north",
          "bottom": "south",
          "center": "",
          "baseline": "base",
      }
      return "anchor={} {}".format(va_mpl_to_tikz[va], ha_mpl_to_tikz[ha]).strip()
docs: Converts matplotlib positioning to pgf node positioning.
      Not quite accurate but the results are equivalent more or less.