MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _revert

Method _revert

lib/matplotlib/sankey.py:332–348  ·  view source on GitHub ↗

A path is not simply reversible by path[::-1] since the code specifies an action to take from the **previous** point.

(self, path, first_action=Path.LINETO)

Source from the content-addressed store, hash-verified

330 return tip, label_location
331
332 def _revert(self, path, first_action=Path.LINETO):
333 """
334 A path is not simply reversible by path[::-1] since the code
335 specifies an action to take from the **previous** point.
336 """
337 reverse_path = []
338 next_code = first_action
339 for code, position in path[::-1]:
340 reverse_path.append((next_code, position))
341 next_code = code
342 return reverse_path
343 # This might be more efficient, but it fails because 'tuple' object
344 # doesn't support item assignment:
345 # path[1] = path[1][-1:0:-1]
346 # path[1][0] = first_action
347 # path[2] = path[2][::-1]
348 # return path
349
350 @_docstring.interpd
351 def add(self, patchlabel='', flows=None, orientations=None, labels='',

Callers 1

addMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected