I'm playing around with cartopy trying to understand how it works. The first thing I tried was very similar to the example in the docs under the 'Adding Data to the Map' section.
I'm trying to draw a straight line from Adelaide, Australia to Liverpool, UK on my Robinson projection. This is my code:
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
ax = plt.axes(projection=ccrs.Robinson())
ax.coastlines()
ax.stock_img()
ad_lat, ad_lon = -34.93, 138.60
liv_lat, liv_lon = 53.41, -2.99
plt.plot([ad_lon, liv_lon], [ad_lat, liv_lat],
color='blue', linewidth=1, marker='o', markersize=3,
)
plt.show()
However this produces a single marker in the middle of the map. The docs say that by default, if you don't specify a transform property to plt.plot, it uses the one for the axes (Robinson in this case). When I explicitly add 'transform=ccrs.Robinson()' the same thing happens. However, it does let me use 'ccrs.Geodetic()' for a curved line, or ccrs.PlateCarree() for a slightly wonky straight line.
I can't find anything in the docs about the transform property being limited to some projections but not others, so I don't understand why this is happening. Can anyone shed some light on this?