code: def setup_axes2(fig, rect):
      """
      With custom locator and formatter.
      Note that the extreme values are swapped.
      """
      tr = PolarAxes.PolarTransform(apply_theta_transforms=False)
  
      pi = np.pi
      angle_ticks = [
          (0, r"$0$"),
          (0.25 * pi, r"$\frac{1}{4}\pi$"),
          (0.5 * pi, r"$\frac{1}{2}\pi$"),
      ]
      grid_locator1 = FixedLocator([v for v, s in angle_ticks])
      tick_formatter1 = DictFormatter(dict(angle_ticks))
  
      grid_locator2 = MaxNLocator(2)
  
      grid_helper = floating_axes.GridHelperCurveLinear(
          tr,
          extremes=(0.5 * pi, 0, 2, 1),
          grid_locator1=grid_locator1,
          grid_locator2=grid_locator2,
          tick_formatter1=tick_formatter1,
          tick_formatter2=None,
      )
  
      ax1 = fig.add_subplot(
          rect,
          axes_class=floating_axes.FloatingAxes,
          grid_helper=grid_helper,
      )
      ax1.grid()
  
      # create a parasite Axes whose transData in RA, cz
      aux_ax = ax1.get_aux_axes(tr)
  
      aux_ax.patch = (
          ax1.patch
      )  # for aux_ax to have a clip path as in ax
      ax1.patch.zorder = (
          0.9  # but this has a side effect that the patch is
      )
      # drawn twice, and possibly over some other
      # artists. So, we decrease the zorder a bit to
      # prevent this.
  
      return ax1, aux_ax
  
file_path: matplotlib/galleries/examples/axisartist/demo_floating_axes.py
imports: import matplotlib.pyplot
  import numpy
  from matplotlib.projections import PolarAxes
  from matplotlib.transforms import Affine2D
  import mpl_toolkits.axisartist.angle_helper
  import mpl_toolkits.axisartist.floating_axes
  from mpl_toolkits.axisartist.grid_finder import DictFormatter, FixedLocator, MaxNLocator
label_desc: Use image node_id 2 for calling a global function with example usage: setup_axes2(fig, rect) and returns: ax1,  aux_ax