Skip to content

Commit 2960f8d

Browse files
committed
Apply review changes to previous pull request
1 parent 59dc461 commit 2960f8d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/mpl_toolkits/basemap/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3432,13 +3432,13 @@ def pcolormesh(self,x,y,data,**kwargs):
34323432
"""
34333433
ax, plt = self._ax_plt_from_kw(kwargs)
34343434
# fix for invalid grid points
3435-
if ((np.any(x > 1e20) or np.any (y > 1e20)) and
3436-
len(x.shape) == 2 and len(y.shape) == 2):
3437-
if not x.shape == y.shape:
3438-
raise Exception('pcolormesh: x and y need same dimension')
3435+
if ((np.any(x > 1e20) or np.any(y > 1e20)) and
3436+
x.ndim == 2 and y.ndim == 2):
3437+
if x.shape != y.shape:
3438+
raise ValueError('pcolormesh: x and y need same dimension')
34393439
nx,ny = x.shape
34403440
if nx < data.shape[0] or ny < data.shape[1]:
3441-
raise Exception('pcolormesh: data dimension needs to be at least that of x and y.')
3441+
raise ValueError('pcolormesh: data dimension needs to be at least that of x and y.')
34423442
mask = (
34433443
(x[:-1,:-1] > 1e20) |
34443444
(x[1:,:-1] > 1e20) |

0 commit comments

Comments
 (0)