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

Skip to content

Commit e7f4654

Browse files
committed
Bugfix in pcolormesh
svn path=/trunk/matplotlib/; revision=2975
1 parent 7006c9c commit e7f4654

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/matplotlib/axes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4233,7 +4233,7 @@ def pcolormesh(self, *args, **kwargs):
42334233
Y = transpose(resize(ravel(Y), (Nx, Ny)))
42344234

42354235
# convert to one dimensional arrays
4236-
C = ma.ravel(C[0:Nx-1, 0:Ny-1]) # data point in each cell is value at lower left corner
4236+
C = ma.ravel(C[0:Ny-1, 0:Nx-1]) # data point in each cell is value at lower left corner
42374237
X = ravel(X)
42384238
Y = ravel(Y)
42394239

@@ -4242,14 +4242,13 @@ def pcolormesh(self, *args, **kwargs):
42424242
# to Float32 with simple assignment, so we do it explicitly.
42434243
coords[:, 0] = X.astype(Float32)
42444244
coords[:, 1] = Y.astype(Float32)
4245-
#print coords
42464245

42474246
if shading == 'faceted':
42484247
showedges = 1
42494248
else:
42504249
showedges = 0
42514250

4252-
collection = QuadMesh(Ny - 1, Nx - 1, coords, showedges, **kwargs)
4251+
collection = QuadMesh(Nx - 1, Ny - 1, coords, showedges, **kwargs)
42534252
collection.set_alpha(alpha)
42544253
collection.set_array(C)
42554254
if norm is not None: assert(isinstance(norm, Normalize))

0 commit comments

Comments
 (0)