code: def _get_factors(self, element):
          
          xdim, ydim = element.dimensions()[:2]
          xvals, yvals = [element.dimension_values(i, False)
                          for i in range(2)]
          coords = tuple([v if vals.dtype.kind in 'SU' else dim.pprint_value(v) for v in vals]
                    for dim, vals in [(xdim, xvals), (ydim, yvals)])
          if self.invert_axes: coords = coords[::-1]
          return coords
docs: Get factors for categorical axes.