From 039a82f57490315ab6b629a869e2fc5e05c1991e Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Mon, 14 Sep 2015 21:06:19 +0100 Subject: [PATCH] Bugfix for TriAnalyzer mismatched indexes --- lib/matplotlib/tri/tritools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/tri/tritools.py b/lib/matplotlib/tri/tritools.py index e8efae05ebc9..35e382c98a75 100644 --- a/lib/matplotlib/tri/tritools.py +++ b/lib/matplotlib/tri/tritools.py @@ -48,7 +48,8 @@ def scale_factors(self): """ compressed_triangles = self._triangulation.get_masked_triangles() - node_used = (np.bincount(np.ravel(compressed_triangles)) != 0) + node_used = (np.bincount(np.ravel(compressed_triangles), + minlength=self._triangulation.x.size) != 0) x = self._triangulation.x[node_used] y = self._triangulation.y[node_used] ux = np.max(x)-np.min(x)