standardize_2d

standardize_2d(self, *args, data=None, autoformat=None, order='C', globe=False, **kwargs)[source]

Interpret positional arguments for the “2D” plotting methods so usage is consistent. Positional arguments are standardized as follows:

  • If x and y or latitude and longitude coordinates were not provided, and a DataFrame or DataArray is passed, we try to infer them from the metadata. Otherwise, np.arange(0, data.shape[0]) and np.arange(0, data.shape[1]) are used.

  • For pcolor and pcolormesh, coordinate edges are calculated if centers were provided. This uses the edges and edges2d functions. For all other methods, coordinate centers are calculated if edges were provided.

Important

This function wraps contour, contourf, pcolor, pcolormesh, pcolorfast, streamplot, quiver, and barbs.

Parameters
  • data (dict-like, optional) – A dict-like dataset container (e.g., DataFrame or DataArray). If passed, positional arguments must be valid data keys and the arrays used for plotting are retrieved with data[key]. This is a native matplotlib feature previously restricted to just plot and scatter.

  • autoformat (bool, optional) – Whether x axis labels, y axis labels, axis formatters, axes titles, legend labels, and colorbar labels are automatically configured when a Series, DataFrame or DataArray is passed to the plotting command. Default is rc.autoformat = True.

  • order ({‘C’, ‘F’}, optional) – If 'C', arrays should be shaped (y, x). If 'F', arrays should be shaped (x, y). Default is 'C'.

  • globe (bool, optional) – Whether to ensure global coverage for GeoAxes plots. Default is False. When set to True this does the following:

    1. Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.

    2. Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.

    3. For BasemapAxes, 1D longitude vectors are also cycled to fit within the map edges. For example, if the projection central longitude is 90°, the data is shifted so that it spans -90° to 270°.