Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 024fc29

Browse files
committed
ENH : add look-up dictionary for step functions
Add dict to cbook to map strings -> functions
1 parent aa3102c commit 024fc29

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/cbook.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,6 +2551,12 @@ def pts_to_midstep(x, *args):
25512551
# convert 2D array back to tuple
25522552
return tuple(steps)
25532553

2554+
STEP_LOOKUP_MAP = {'pre': pts_to_prestep,
2555+
'post': pts_to_poststep,
2556+
'mid': pts_to_midstep,
2557+
'step-pre': pts_to_prestep,
2558+
'step-post': pts_to_poststep,
2559+
'step-mid': pts_to_midstep}
25542560

25552561
# Numpy > 1.6.x deprecates putmask in favor of the new copyto.
25562562
# So long as we support versions 1.6.x and less, we need the

0 commit comments

Comments
 (0)