Skip to content

Commit

Permalink
Merge pull request SciTools#2298 from greglucas/force-ccw-fix
Browse files Browse the repository at this point in the history
FIX: Remove force_path_ccw of contours
  • Loading branch information
rcomer authored Dec 18, 2023
2 parents d53abfe + 5f55005 commit 879f84f
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,7 @@ def transform_path_non_affine(self, src_path):
return mpath.Path(self.transform(src_path.vertices))

transformed_geoms = []
# Check whether this transform has the "force_path_ccw" attribute set.
# This is a cartopy extension to the Transform API to allow finer
# control of Path orientation handling (Path ordering is not important
# in matplotlib, but is in Cartopy).
geoms = cpatch.path_to_geos(src_path,
getattr(self, 'force_path_ccw', False))
geoms = cpatch.path_to_geos(src_path)

for geom in geoms:
proj_geom = self.target_projection.project_geometry(
Expand Down Expand Up @@ -1639,16 +1634,6 @@ def contourf(self, *args, **kwargs):
arguments X and Y must be provided and be 2-dimensional.
The default is False, to compute the contours in data-space.
"""
t = kwargs.get('transform')
if isinstance(t, ccrs.Projection):
kwargs['transform'] = t = t._as_mpl_transform(self)
# Set flag to indicate correcting orientation of paths if not ccw
if isinstance(t, mtransforms.Transform):
for sub_trans, _ in t._iter_break_from_left_to_right():
if isinstance(sub_trans, InterProjectionTransform):
if not hasattr(sub_trans, 'force_path_ccw'):
sub_trans.force_path_ccw = True

result = super().contourf(*args, **kwargs)

# We need to compute the dataLim correctly for contours.
Expand Down

0 comments on commit 879f84f

Please sign in to comment.