code: def sample_data_3d(shape):
      """Return `lons`, `lats`, `times` and fake `data`"""
      ntimes, nlats, nlons = shape
      lats = np.linspace(-np.pi / 2, np.pi / 2, nlats)
      lons = np.linspace(0, 2 * np.pi, nlons)
      lons, lats = np.meshgrid(lons, lats)
      wave = 0.75 * (np.sin(2 * lats) ** 8) * np.cos(4 * lons)
      mean = 0.5 * np.cos(2 * lats) * ((np.sin(2 * lats)) ** 2 + 2)
  
      lats = np.rad2deg(lats)
      lons = np.rad2deg(lons)
      data = wave + mean
  
      times = np.linspace(-1, 1, ntimes)
      new_shape = data.shape + (ntimes,)
      data = np.rollaxis(data.repeat(ntimes).reshape(new_shape), -1)
      data *= times[:, np.newaxis, np.newaxis]
  
      return lons, lats, times, data
  
file_path: cartopy/examples/miscellanea/axes_grid_basic.py
imports: import matplotlib.pyplot
  from mpl_toolkits.axes_grid1 import AxesGrid
  import numpy
  import cartopy.crs
  from cartopy.mpl.geoaxes import GeoAxes
  from cartopy.mpl.ticker import LatitudeFormatter, LongitudeFormatter
label_desc: Use image node_id 1 for calling a global function with example usage: sample_data_3d(shape) and returns: lons,  lats,  times,  data