8000 Raise a ValueError when trying to init a LogScale with an invalid base · matplotlib/matplotlib@5b10ba8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b10ba8

Browse files
committed
Raise a ValueError when trying to init a LogScale with an invalid base
1 parent e0ff766 commit 5b10ba8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/scale.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ def __init__(self, axis, **kwargs):
253253

254254
if nonpos not in ['mask', 'clip']:
255255
raise ValueError("nonposx, nonposy kwarg must be 'mask' or 'clip'")
256+
if base <= 0 or base == 1:
257+
raise ValueError('The log base cannot be <= 0 or == 1.')
256258

257259
if base == 10.0:
258260
self._transform = self.Log10Transform(nonpos)

0 commit comments

Comments
 (0)
0