Plotting trajectories which wrap around the globe

27 views
Skip to first unread message

Susan

unread,
Dec 19, 2016, 11:05:28 AM12/19/16
to Iris
Hi,

I'm trying to plot trajectories (basically the latitude and longitude coordinates of a 1D cube) and I'm struggling to get them to wrap around the globe. Instead of disappearing off one edge of the plot and appearing at the other the trajectories are plotted as straight lines across the plot (see picture). I've tried including the "circular" attribute but it doesn't seem to make a difference.

Here is an excerpt from my code:

ax = plt.axes(projection=ccrs.PlateCarree())
ax
.coastlines()
gl
= ax.gridlines(draw_labels=True)

for cube in cubes:
    cube
.coord('longitude').circular = True
    lon
= cube.coord('longitude')
    lat
= cube.coord('latitude')
    iplt
.plot(lon, lat, linewidth=2)

plt
.show()

In the native format of my data the trajectories' longitudes range from -180:180. I've also tried rotating them to 0:360 but this has also made no difference.

Have I used the "circular" attribute correctly or is there something else I'm missing?

Thank you for your help.

Susan


Reply all
Reply to author
Forward
0 new messages