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

FIX: Remove force_path_ccw of contours #2298

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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