diff --git a/src/boututils/showdata.py b/src/boututils/showdata.py index c0cfbfdcb..b83162b8b 100644 --- a/src/boututils/showdata.py +++ b/src/boututils/showdata.py @@ -446,7 +446,7 @@ def showdata( + ", the shape of x is not compatible with the shape of the " "variable. Shape of x should be (Nx), (Nx,Ny) or (Nt,Nx,Ny)." ) - except ValueError: + except (ValueError, IndexError): for j in range(0, Nlines[i]): xnew[i].append(linspace(0, Nx[i][j] - 1, Nx[i][j])) @@ -468,7 +468,7 @@ def showdata( + ", the shape of y is not compatible with the shape of the " "variable. Shape of y should be (Ny), (Nx,Ny) or (Nt,Nx,Ny)." ) - except ValueError: + except (ValueError, IndexError): ynew.append(linspace(0, Ny[i][0] - 1, Ny[i][0])) else: ynew.append(0)