Skip to content

Commit

Permalink
FIX: enable passing RGB(A) to polormesh
Browse files Browse the repository at this point in the history
  • Loading branch information
rcomer committed Apr 6, 2023
1 parent c8f1b0f commit 08ee082
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,7 @@ def _wrap_args(self, *args, **kwargs):
kwargs['shading'] = 'flat'
X = np.asanyarray(args[0])
Y = np.asanyarray(args[1])
nrows, ncols = np.asanyarray(args[2]).shape
nrows, ncols = np.asanyarray(args[2]).shape[:2]
Nx = X.shape[-1]
Ny = Y.shape[0]
if X.ndim != 2 or X.shape[0] == 1:
Expand Down Expand Up @@ -1843,12 +1843,13 @@ def _wrap_quadmesh(self, collection, **kwargs):
Ny, Nx, _ = coords.shape
if kwargs.get('shading') == 'gouraud':
# Gouraud shading has the same shape for coords and data
data_shape = Ny, Nx
data_shape = Ny, Nx, -1
else:
data_shape = Ny - 1, Nx - 1
data_shape = Ny - 1, Nx - 1, -1
# data array
C = collection.get_array().reshape(data_shape)

if C.shape[-1] == 1:
C = C.squeeze(axis=-1)
transformed_pts = self.projection.transform_points(
t, coords[..., 0], coords[..., 1])

Expand Down

0 comments on commit 08ee082

Please sign in to comment.