File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,20 @@ def draw_pathcollection(data, obj):
250
250
for path in obj .get_paths ():
251
251
if is_contour :
252
252
dd = path .vertices
253
- dd_strings = np .array ([[fmt .format (val ) for val in row ] for row in dd ])
253
+ # https://matplotlib.org/stable/api/path_api.html
254
+ codes = (
255
+ path .codes
256
+ if path .codes is not None
257
+ else np .array ([1 ] + [2 ] * (len (dd ) - 1 ))
258
+ )
259
+ dd_strings = []
260
+ for row , code in zip (dd , codes ):
261
+ if code == 1 : # MOVETO
262
+ dd_strings += [
263
+ []
264
+ ] # Inserts a newline to trigger "move to" in pgfplots
265
+ dd_strings += [[fmt .format (val ) for val in row ]]
266
+ dd_strings = np .array (dd_strings [1 :])
254
267
255
268
if len (obj .get_sizes ()) == len (dd ):
256
269
# See Pgfplots manual, chapter 4.25.
You can’t perform that action at this time.
0 commit comments