Skip to content

Commit

Permalink
Fix barbs for 1d inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajdawson committed Oct 7, 2016
1 parent d20e2d1 commit 1839329
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ def quiver(self, x, y, u, v, *args, **kwargs):

def barbs(self, x, y, u, v, *args, **kwargs):
"""
Plot a 2-D field of barbs.
Plot a field of barbs.
Extra Kwargs:
Expand Down Expand Up @@ -1577,7 +1577,7 @@ def barbs(self, x, y, u, v, *args, **kwargs):
elif t != self.projection:
# Transform the vectors if the projection is not the same as the
# data transform.
if x.ndim == 1 and y.ndim == 1:
if (x.ndim == 1 and y.ndim == 1) and (x.shape != u.shape):
x, y = np.meshgrid(x, y)
u, v = self.projection.transform_vectors(t, x, y, u, v)
return matplotlib.axes.Axes.barbs(self, x, y, u, v, *args, **kwargs)
Expand Down

0 comments on commit 1839329

Please sign in to comment.