Skip to content

Commit d533912

Browse files
committed
incorporate #16822
1 parent b59b310 commit d533912

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/matplotlib/path.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,11 @@ def make_compound_path(cls, *args):
337337
codes = np.empty(len(vertices), dtype=cls.code_type)
338338
i = 0
339339
for path in args:
340-
codes = path.codes
341-
if codes is None:
342-
codes = np.full(len(path.vertices), Path.LINETO,
343-
dtype=Path.code_type)
344-
codes[0] = Path.MOVETO # so concatenated strokes stay separate
345-
codes[i:i + len(path.codes)] = codes
340+
if path.codes is None:
341+
codes[i] = cls.MOVETO
342+
codes[i + 1:i + len(codes)] = cls.LINETO
343+
else:
344+
codes[i:i + len(path.codes)] = path.codes
346345
i += len(path.vertices)
347346
# remove STOP's, since internal STOPs are a bug
348347
not_stop_mask = codes != cls.STOP

0 commit comments

Comments
 (0)