Skip to content

Conversation

@rcomer
Copy link
Member

@rcomer rcomer commented Jul 18, 2023

PR summary

Closes #26340

I didn't add a changenote because I think this is covered by "Setting properties on the ContourSet can now usually be done using standard collection setters"
https://matplotlib.org/devdocs/api/next_api_changes/behavior/25247-AL.html

PR checklist

@rcomer
Copy link
Member Author

rcomer commented Jul 18, 2023

I have also tested this for the Cartopy case.

@rcomer rcomer added this to the v3.8.0 milestone Jul 18, 2023
Comment on lines 980 to 982
def set_paths(self, paths):
self._paths = paths
self.stale = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @anntzer's comment #26340 (comment)
I think we could just add this change to Collection.set_paths(paths) method definition instead so others can also subclass and take advantage of it (could remove the method definition from PathCollection then too I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, I misread @anntzer's comment. I've now updated Collection.set_paths. I left my test in because set_paths does not appear in test_collection.py. I assume the ContourSet is as good a place as any to make sure this code path is covered?

@rcomer rcomer changed the title ENH: ContourSet.set_paths ENH: Collection.set_paths Jul 19, 2023
@greglucas greglucas merged commit 17412bf into matplotlib:main Jul 19, 2023
@rcomer rcomer deleted the cs-set_paths branch July 19, 2023 13:47
@rcomer rcomer mentioned this pull request Oct 16, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH]: ContourSet.set_paths

3 participants