# Curvilinear grid with modified axes labels

I have studied how to make floating axes with curvilinear grids. However, I cannot figure out how to achieve my desired goals.

The code snippet below is a distillation that takes me part-way there. I cannot seem to access/modify the radial tick labels and their locations.

I am plotting data in a latitude/longitude coordinate system. I am converting latitude to the radial coordinate, and longitude is the angular coordinate. My plot extends from 90 degrees latitude (= zero radius) to 50 degrees latitude (=cos(50) radius). The
figure appears like a pie wedge, with the point of the pie pointing down and the circular part of the wedge at the top.I can easily translate the data into radius/angle coordinates for the plotting.

What I cannot figure out is how to change the radial axis labels. I want these to go from 90 to 50. That is, coordinate 0 should have the label “90”, and coordinate 50 should have the label “50”. Since I am not versed in the various low-level artists,
I cannot figure out how to change the axis labels. By default, the tick labels run from 0 to 50.

In the code below, I manipulate the object called ax1.axis[“left”]. I can toggle the labels on and off, and whether there is a text label. However, I cannot figure out how to set the tick labels and where they are located. In all the examples I’ve seen
online, defaults axes labels are used, so I don’t know how to do this. I have searched the documentation but cannot find a function that allows me to set tick labels and their locations. In the pylab interface, this can be done, e.g. with ax.set_xticks and
ax.set_xticklabels. I don’t know how to do this without the pylab interface.

Help is appreciated! Thank you.

···

=======================

import numpy as np

import matplotlib.pyplot as plt

import mpl_toolkits.axisartist.floating_axes as floating_axes

from matplotlib.projections import PolarAxes

from matplotlib.transforms import Affine2D

fig = plt.figure()

tr_rotate = Affine2D().translate(30, 0)

tr_scale = Affine2D().scale(np.pi/180., 1.)

tr = tr_rotate + tr_scale + PolarAxes.PolarTransform()

grid_helper = floating_axes.GridHelperCurveLinear( tr, extremes=( 0, 120,

0.0, 50.0), tick_formatter1 = None, tick_formatter2 = None )

ax1 = floating_axes.FloatingSubplot( fig, 111, grid_helper=grid_helper )

ax1.axis[“left”].set_axis_direction(“bottom”)

ax1.axis[“right”].set_axis_direction(“top”)

ax1.axis[“bottom”].set_visible(False)

ax1.axis[“top”].set_axis_direction(“bottom”)

ax1.axis[“top”].toggle(ticklabels=False, label=False)

ax1.axis[“left”].toggle(ticklabels=False, label=False) # This is radial axis, outside.

ax1.axis[“top”].major_ticklabels.set_axis_direction(“top”)

ax1.axis[“top”].label.set_axis_direction(“top”)

a = ax1.axis[“left”]

a.toggle(ticklabels=True, label=True)

a.label.set_text(“Magnetic Latitude”)

aux_ax = ax1.get_aux_axes(tr)

aux_ax.patch = ax1.patch

aux_ax.plot([55.0, 55.0, 65.0, 45.0], [45., 30.0, 10., 20.], marker=‘o’, ls=’’)

ax1.grid( True )

plt.show()

=======================

-Tony

Tony Mannucci

Supervisor, Ionospheric and Atmospheric Remote Sensing Group

Mail-Stop 138-308, Tel > (818) 354-1699

Jet Propulsion Laboratory, Fax > (818) 393-5115

California Institute of Technology, Email > Tony.Mannucci@…369…

4800 Oak Grove Drive, http://scienceandtechnology.jpl.nasa.gov/people/a_mannucci/