Browse code

fixes plotting bug that happened when there are only 4 points

Bas Nijholt authored on 09/01/2018 12:41:30
Showing 1 changed files
... ...
@@ -324,6 +324,7 @@ class Learner2D(BaseLearner):
324 324
                 # Calculate how many grid points are needed.
325 325
                 # factor from A=√3/4a² (equilateral triangle)
326 326
                 n = int(0.658 / sqrt(areas(ip).min()))
327
+                n = max(n, 10)
327 328
 
328 329
             x = y = np.linspace(-0.5, 0.5, n)
329 330
             z = ip(x[:, None], y[None, :]).squeeze()