Repository: has2k1/mizani

Issue:
breaks.log_breaks errors for narrow range if base=2
The following code: 

```{python}
x = [
    1.768712, 1.7549, 1.836442, 1.79616, 1.57543, 1.519078, 1.861349, 1.905086,
    1.86907, 1.818797, 0.588072, 0.723217, 0.636356, 0.707729, 0.681214, 0.79747, 
    0.961983, 0.985598, 1.027589, 1.102333
]
limits = min(x), max(x)
breaks = breaks.log_breaks(base = 2)(limits)
```

correctly falls through to ```_log_sub_breaks``` but errors due to lines 223-224:

```{python}
if self.base == 2:
    return base ** np.arange(_min, _max+1)
```

as dtype is not specified as ```float```.

Hence, there is also no way for ```base=2``` to fall through to the ```extended_breaks``` function. Should this be the case?

Discussion:

Patch:
diff --git a/mizani/breaks.py b/mizani/breaks.py
index ecb7e4d..624b6d7 100644
--- a/mizani/breaks.py
+++ b/mizani/breaks.py
@@ -221,7 +221,7 @@ class _log_sub_breaks:
             return np.min(np.diff(log_arr))
 
         if self.base == 2:
-            return base ** np.arange(_min, _max+1)
+            return base ** np.arange(_min, _max+1, dtype=dtype)
 
         candidate = np.arange(base+1)
         candidate = np.compress(


Test patch:
diff --git a/mizani/tests/test_breaks.py b/mizani/tests/test_breaks.py
index 20377ba..7f80ee9 100644
--- a/mizani/tests/test_breaks.py
+++ b/mizani/tests/test_breaks.py
@@ -99,6 +99,13 @@ def test_log_breaks():
         [16, 32, 64, 128]
     )
 
+    # bases & negative breaks
+    breaks = log_breaks(base=2)([0.9, 2.9])
+    npt.assert_array_almost_equal(
+        breaks,
+        [0.5, 1., 2., 4.]
+    )
+
 
 def test_minor_breaks():
     # equidistant breaks