Closed
Milestone
Description
Problem
To get contour labelling working with its special transforms, Cartopy has a workaround where it replaces all the paths on the ContourSet with transformed versions. This currently looks like
paths = cs.get_paths()
paths[:] = transformed_pathswhich doesn’t smell very good.
Proposed solution
The above would smell better as
cs.set_paths(transformed_paths)
Activity
anntzer commentedon Jul 18, 2023
I'm actually a bit confused as to why Collection.set_paths raises NotImplementedError instead of setting self._paths (which is what Collection.get_paths already returns).
rcomer commentedon Jul 18, 2023
Thanks @anntzer. So would it be enough to just copy what
PathCollectionhas?matplotlib/lib/matplotlib/collections.py
Lines 1004 to 1006 in 2a4d905
anntzer commentedon Jul 18, 2023
Untested, but possibly yes?