transform=projection
Hi,
I want to plot the eddy trajectories by centering the map over the Pacific instead of the Atlantic (central_longitude=180). the background cartopy map changes how I want, but the eddy trajectories stay centered as before even if I use transform=projection. As far as I have tries, also changing the ref in .plot does not help. All that I'm saying is in the code below
Code
%matplotlib inline
lonshift = 180
proj=ccrs.PlateCarree(central_longitude = lonshift)
fig, ax = plt.subplots(1, 1, figsize=(40, 15), subplot_kw={'projection': proj})
gl = ax.gridlines(draw_labels=True, y_inline=True) # need cartopy version 0.18!!!
gl.top_labels = False
gl.xformatter = LongitudeFormatter()
gl.yformatter = LatitudeFormatter()
land = cfeature.NaturalEarthFeature(
category='physical',
name='land',
scale='10m',
facecolor='grey')
ax.add_feature(land)
# a_20y and c_20y are just eddy trajectory datasets in the pyeddytracker format
a_20y.plot(ax, ref=180, label="Anticyclonic ({nb_tracks} tracks)", color="r", lw=1, transform=proj)
c_20y.plot(ax, ref=180, label="Cyclonic ({nb_tracks} tracks)", color="b", lw=1, transform=proj)
ax.legend(fontsize=20, loc='lower right')
How could I get the trajectoreis to also transform in the projection that I want? Is there some function I'm missing?
transform=projection Hi, I want to plot the eddy trajectories by centering the map over the Pacific instead of the Atlantic (central_longitude=180). the background cartopy map changes how I want, but the eddy trajectories stay centered as before even if I use transform=projection. As far as I have tries, also changing the ref in .plot does not help. All that I'm saying is in the code below
Code
How could I get the trajectoreis to also transform in the projection that I want? Is there some function I'm missing?
Thank you! Stella