geoviews Path elements behave differently depending on the central_longitude of the projection parameter. With the default projection=crs.PlateCarree(central_longitude=0.0), lines on a 0-360 longitude grid are only drawn for points <=180 degrees. With any other central longitude (e.g. central_longitude=0) points > 180 are wrapped to the (-180, 0) range, and paths that cross the dateline are wrapped appropriately as well.
I tried to reproduce this behavior with just pyplot and cartopy, but without geoviews no points are wrapped even with central_longitude=0. However, I can get the behavior I want in this configuration by passing in transform=crs.Geodetic() to the ax.plot call. This makes me think that geoviews is transforming the data only when the central_longitude is not 0.0 but I'm not super familiar with how geoviews, cartopy and matplotlib interact and can't find anything in the source supporting my idea.
Another thought I had is that geoviews is just following a different code path with cartopy than matplotlib does, in which case the source of the strange behavior is cartopy. Either way it seems like it would be good to figure out why this is happening and at least document it to avoid confusion.
Thanks for reporting this, at a quick glance I couldn't see why it would treat a float and an integer differently but this is definitely worth investigating.
geoviews
Path
elements behave differently depending on thecentral_longitude
of the projection parameter. With the defaultprojection=crs.PlateCarree(central_longitude=0.0)
, lines on a 0-360 longitude grid are only drawn for points <=180 degrees. With any other central longitude (e.g.central_longitude=0
) points > 180 are wrapped to the (-180, 0) range, and paths that cross the dateline are wrapped appropriately as well.I tried to reproduce this behavior with just pyplot and cartopy, but without geoviews no points are wrapped even with
central_longitude=0
. However, I can get the behavior I want in this configuration by passing intransform=crs.Geodetic()
to theax.plot
call. This makes me think that geoviews is transforming the data only when the central_longitude is not 0.0 but I'm not super familiar with how geoviews, cartopy and matplotlib interact and can't find anything in the source supporting my idea.Another thought I had is that geoviews is just following a different code path with cartopy than matplotlib does, in which case the source of the strange behavior is cartopy. Either way it seems like it would be good to figure out why this is happening and at least document it to avoid confusion.