Is there a transform similar to PlateCarree for a vertical slice on the equator

I have been using to make plots of GC2 ocean data

fig = plt.figure(figsize=(12, 7.5))    
ax = plt.axes((0.05, 0, 0.90, 1), projection=PlateCarree(central_longitude=180))
obj = ax.pcolormesh(lon, lat, var, transform=PlateCarree())

I would like to be able to do something similar but with depth.

fig = plt.figure(figsize=(12, 7.5))    
ax = plt.axes((0.05, 0, 0.90, 1), projection=LongitudeDepthTransform(central_longitude=180))
obj = ax.pcolormesh(lon, depth, var, transform=LongitudeDepthTransform())

Depth values increase from 0 and longitude behaves the same as PlateCarree.

I am wondering if this transform exists somewhere already?

And if it not, how easy would it be to create?


What are you after here? The ocean is just a very thin anulus at the equator. If you project it onto platte carre it’s just a rectangular box with evenly spaced lines of longitude. So you don’t need a projection. But maybe I’m missing what you are asking.

Thanks for the reply.

I have a 2D array of longitude by depth (at the equator). If I use PlateCarree for a longitude by latitude plot I am fine.

I cannot use a PlateCarree transform for longitude by depth because the depth values are not degrees in the range -90 to 90.

So I would like a transform that gives me the PlateCarree(central_longitude=180) central_longitude functionality, but not the latitude constraint.

I feel I could use this for vertical sections at the equator and possibly hovmoller plots.

So your clarification question has given me further options to investigate.



A geographic projection is in general a non-linear mapping from lon, lat → x, y. In this case you want lon, z → x, y, and that is a linear transform, and doesn’t require a projection at all. Just do pcolormesh(lon, z, Data)


If I have data with longitudinal coordinates from -180 to 180 (or -107 to 253)

ax = plt.axes((0.05, 0, 0.90, 1), projection=PlateCarree(central_longitude=180))

maps the coordinates I have to 0 → 360 (regardless of what they might be).

So I guess you are telling me that I am over-complicating the problem and I should just np.roll the arrays and lon = (lon + 360) % 360 to get values from 0 to 360.