edges

edges(z, axis=- 1)[source]

Calculate the approximate “edge” values along an axis given “center” values. This is used internally to calculate graticule edges when you supply centers to pcolor or pcolormesh. It is also used to calculate colormap level boundaries when you supply centers to plotting methods wrapped by apply_cmap.

Parameters
  • z (array-like) – Array of any shape or size.

  • axis (int, optional) – The axis along which “edges” are calculated. The size of this axis will be increased by one.

Returns

ndarray – Array of “edge” coordinates.