Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f2ff060

Browse filesBrowse files
committed
Merge pull request #1655 from toddrjen/get_segments
add get_segments method to collections.LineCollection
2 parents a665710 + faf58d5 commit f2ff060
Copy full SHA for f2ff060

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed

‎lib/matplotlib/collections.py

Copy file name to clipboardExpand all lines: lib/matplotlib/collections.py
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,16 @@ def set_segments(self, segments):
10081008
set_verts = set_segments # for compatibility with PolyCollection
10091009
set_paths = set_segments
10101010

1011+
def get_segments(self):
1012+
segments = []
1013+
1014+
for path in self._paths:
1015+
vertices = [vertex for vertex, _ in path.iter_segments()]
1016+
vertices = np.asarray(vertices)
1017+
segments.append(vertices)
1018+
1019+
return segments
1020+
10111021
def _add_offsets(self, segs):
10121022
offsets = self._uniform_offsets
10131023
Nsegs = len(segs)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.