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

Skip to content

Commit 964a854

Browse files
_delaunay.cpp: support [x0:x1:1j] grids even if x1!=x0
1 parent 7d3d2f4 commit 964a854

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/matplotlib/delaunay/_delaunay.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ static PyObject *linear_interpolate_grid(double x0, double x1, int xsteps,
289289
if (!z) return NULL;
290290
z_ptr = (double*)PyArray_DATA(z);
291291

292-
dx = ( x1==x0 ? 0 : (x1 - x0) / (xsteps-1) );
293-
dy = ( y1==y0 ? 0 : (y1 - y0) / (ysteps-1) );
292+
dx = ( xsteps==1 ? 0 : (x1 - x0) / (xsteps-1) );
293+
dy = ( ysteps==1 ? 0 : (y1 - y0) / (ysteps-1) );
294294

295295
rowtri = 0;
296296
for (iy=0; iy<ysteps; iy++) {

0 commit comments

Comments
 (0)