Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed line is wrapping around the border #1078

Closed
pelson opened this issue Jun 18, 2018 · 2 comments · Fixed by #1162
Closed

Closed line is wrapping around the border #1078

pelson opened this issue Jun 18, 2018 · 2 comments · Fixed by #1162

Comments

@pelson
Copy link
Member

pelson commented Jun 18, 2018

Description

When adding a line that is closed (starts and ends at the same location), it will be interpreted as a polygon, and therefore get the border of the map in the resulting geometry/line.

Code to reproduce

import matplotlib.pyplot as plt
import cartopy.crs as ccrs

plt.figure()
ax = plt.axes(projection=ccrs.PlateCarree())

ax.coastlines()

lons = [0, 170, -170, 0]
lats = [10, 20, 30, 10]

ax.stock_img()
ax.plot(lons, lats, '--', color='orange', linewidth=4, transform=ccrs.Geodetic())
plt.show()

figure_1-2

Cartopy version

v0.16

@pelson
Copy link
Member Author

pelson commented Jun 18, 2018

This could be quite a tricky one, and is pretty much a duplicate of #158.
It suggest the correct solution might be to ensure that matplotlib is producing the appropriate Path codes in all cases (or enforcing that on the GeoAxes).

@pelson
Copy link
Member Author

pelson commented Nov 12, 2018

Wowzers. Thanks for fixing this @QuLogic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants