def setup_axes2(fig, rect):
 tr = PolarAxes.PolarTransform()
 pi = np.pi
 angle_ticks = [(0, '$0$'), ((0.25 * pi), '$\\frac{1}{4}\\pi$'), ((0.5 * pi), '$\\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 = floating_axes.FloatingSubplot(fig, rect, grid_helper=grid_helper)
 fig.add_subplot(ax1)
 aux_ax = ax1.get_aux_axes(tr)
 aux_ax.patch = ax1.patch
 ax1.patch.zorder = 0.9
 return (ax1, aux_ax)

def setup_axes2 ( fig , rect ) : tr = PolarAxes . PolarTransform ( ) pi = np . pi angle_ticks = [ ( 0 , '$0$' ) , ( ( 0.25 * pi ) , '$\\frac{1}{4}\\pi$' ) , ( ( 0.5 * pi ) , '$\\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 = floating_axes . FloatingSubplot ( fig , rect , grid_helper = grid_helper ) fig . add_subplot ( ax1 ) aux_ax = ax1 . get_aux_axes ( tr ) aux_ax . patch = ax1 . patch ax1 . patch . zorder = 0.9 return ( ax1 , aux_ax )
with custom locator and formatter .