Skip to content

Commit

Permalink
tests: add test_contourf_with_conflict_points
Browse files Browse the repository at this point in the history
  • Loading branch information
Clarmy committed Apr 23, 2024
1 parent 55cf125 commit adb8c50
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/cartopy/tests/mpl/test_contour.py
Expand Up @@ -146,3 +146,22 @@ def test_contourf_transform_first(func):
test_func(xx, yy, z, transform=ccrs.PlateCarree(),
transform_first=False)
assert_array_almost_equal(ax.get_extent(), (-180, 180, -25, 25))

def test_contourf_with_conflict_points():
"""Testing the issue mentioned in #2370"""
lons = [96.75, 97. , 97.25]
lats = np.arange(17.25, 15.9, -0.25)

lons, lats = np.meshgrid(lons, lats)

data = [[26.9, 43.7, 26.8],
[33.2, 65.8, 34.6],
[54.7, 66.9, 55.5],
[65.3, 65. , 65.7],
[65.9, 65. , 65.6],
[65.8, 65.2, 65.5]]

fig = plt.figure()
ax = fig.add_subplot(projection=ccrs.Mercator())
ax.contourf(lons, lats, data, levels=[60, 65], transform=ccrs.PlateCarree())
plt.draw()

0 comments on commit adb8c50

Please sign in to comment.