title: How to plot Ocean Currents with Cartopy
body: <p>I am trying to plot a netCDF4 file containing ocean currents from a NASA database for a project, but I keep getting errors such as "x and y coordinates are not compatible with the shape of the vector components".</p>
  
  <p>I have tried changing the streamplot to a contourf (when I did it said that it needed to be a 2d array) which I tried to change but I could not get it to work.</p>
  
  <pre><code>import os
  import matplotlib.pyplot as plt
  from netCDF4 import Dataset as netcdf_dataset
  import numpy as np
  import cartopy.crs as ccrs
  
  fname = "oscar_vel2019.nc.gz.nc"
  
  data=netcdf_dataset(fname)
  v = data.variables['v'][0, :, :, :]
  vf = data.variables['vm'][0, :, :, :]
  u = data.variables['u'][0, :, :, :]
  uf = data.variables['um'][0, :, :, :]
  lats = data.variables['latitude'][:]
  lons = data.variables['longitude'][:]
  ax = plt.axes(projection=ccrs.PlateCarree())
  
  mymap=plt.streamplot(lons, lats, u, v, 60, transform=ccrs.PlateCarree())
  
  ax.coastlines()
  
  plt.show()
  </code></pre>
  
  <p>I would like it to work such that the ocean currents are visible on the plot and to show the movement of particles in the currents through an animation. I really don't have much knowledge with this which is why I am asking. Here is the link from which I got the file: <a href="https://podaac-opendap.jpl.nasa.gov/opendap/hyrax/allData/oscar/preview/L4/oscar_third_deg/oscar_vel2019.nc.gz.html" rel="nofollow noreferrer">https://podaac-opendap.jpl.nasa.gov/opendap/hyrax/allData/oscar/preview/L4/oscar_third_deg/oscar_vel2019.nc.gz.html</a></p>