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

Skip to content

Commit 4fa16f3

Browse files
committed
Removed np.cbrt for compatibility with older numpy versions
1 parent bb042f6 commit 4fa16f3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/matplotlib/cbook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,12 +2719,12 @@ class _StringFuncParser(object):
27192719
np.sqrt,
27202720
True)
27212721
_funcs['cubic'] = _FuncInfo(lambda x: x**3,
2722-
np.cbrt,
2722+
lambda x: x**(1. / 3),
27232723
True)
27242724
_funcs['sqrt'] = _FuncInfo(np.sqrt,
27252725
np.square,
27262726
True)
2727-
_funcs['cbrt'] = _FuncInfo(np.cbrt,
2727+
_funcs['cbrt'] = _FuncInfo(lambda x: x**(1. / 3),
27282728
lambda x: x**3,
27292729
True)
27302730
_funcs['log10'] = _FuncInfo(np.log10,

lib/matplotlib/tests/test_cbook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ class TestFuncParser(object):
530530
np.square,
531531
(lambda x: x**3),
532532
np.sqrt,
533-
np.cbrt,
533+
(lambda x: x**(1. / 3)),
534534
np.log,
535535
np.log10,
536536
np.log2,

0 commit comments

Comments
 (0)