act.plotting.ContourDisplay.create_contour#

ContourDisplay.create_contour(fields=None, time=None, function='cubic', subplot_index=(0,), contour='contourf', grid_delta=(0.01, 0.01), grid_buffer=0.1, twod_dim_value=None, **kwargs)[source]#

Extracts, grids, and creates a contour plot. If subplots have not been added yet, an axis will be created assuming that there is only going to be one plot.

Parameters:
  • fields (dict) – Dictionary of fields to use for x, y, and z data.

  • time (datetime) – Time in which to slice through the datasets.

  • function (string) – Defaults to cubic function for interpolation. See scipy.interpolate.Rbf for additional options.

  • subplot_index (1 or 2D tuple, list, or array) – The index of the subplot to set the x range of.

  • contour (str) – Whether to use contour or contourf as plotting function. Default is contourf

  • grid_delta (1D tuple, list, or array) – x and y deltas for creating grid.

  • grid_buffer (float) – Buffer to apply to grid.

  • twod_dim_value (float) – If the field is 2D, which dimension value to pull. I.e. if dim is depths of [5, 10, 50, 100] specifying 50 would index the data at 50

  • **kwargs (keyword arguments) – The keyword arguments for plt.contour()

Returns:

ax (matplotlib axis handle) – The matplotlib axis handle of the plot.