I have data in x, z
, where x
is longitude in degrees, and z is an altitude in km.
I'd like to be able to use Cartopy's "intelligent" handling of the longitude axis (namely, the ability to center the data at any chosen point lon0
, which handles the data wrapping across the periodic boundary).
if my coordinates were lat
, lon
, this is easy, and involves sending a projection
argument to the axis object, and a transform
argument to the plot object:
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig = plt.figure()
ax = fig.add_subplot(111, projection=ccrs.PlateCarree())
ax.plot(lat, lon, data, transform=ccrs.PlateCarree())
I think what I need to be able to do is effectively only apply the transform
to the x-axis. In other words, I'd like to plot vertical cross sections with the power of Cartopy, rather than the standard use case of horizontal cross sections.
Edit: perhaps all I need to is use a polar transform on the data, where $x$ is interpreted as the angular coordinate. But I would need to do this transformation without doing the associated projection (I still want my plot to be a rectangle, I just want to the data to behave in a period manner)