sdf_xarray.plotting.voxel_plot

Contents

sdf_xarray.plotting.voxel_plot#

sdf_xarray.plotting.voxel_plot(da, ax=None, vmin=None, vmax=None, vcenter=None, mask=None, xlim=(None, None), ylim=(None, None), zlim=(None, None), aspect='equal', elev=30, azim=-60, cmap='viridis', cbar_scale=0.9, **kwargs)[source]#

Plot 3-dimensional data as voxels.

Parameters:
  • da (DataArray) – DataArray to be plotted.

  • ax (Axes | None) – Matplotlib axes on which to plot (This must use a 3d projection).

  • vmin (float | None) – Minimum value. If mask is not stated, will be used to define the mask.

  • vmax (float | None) – Maximum value. If mask is not stated, will be used to define the mask.

  • vcenter (float | None) – Center value of the colourmap. Useful for diverging colourmaps with non-symmetrical data.

  • mask (ndarray[bool] | None) – Array of bools specifying which cells to show. Must be same size as da

  • xlim (tuple[float | None, float | None]) – Sets the limits of the plot.

  • ylim (tuple[float | None, float | None]) – Sets the limits of the plot.

  • zlim (tuple[float | None, float | None]) – Sets the limits of the plot.

  • aspect (Union[Literal['equal', 'auto'], tuple[float, float, float]]) – Aspect ratio of the plot. “equal”, “auto” or list of floats. (default = “equal”)

  • elev (float) – Elevation angle in degrees. (default = 30)

  • azim (float) – Azimuthal angle in degrees. (default = -60)

  • cmap (str) – Colourmap (default = “viridis”)

  • cbar_scale (float) – Vertical scale of the colorbar (default = 0.9)

Return type:

tuple[Figure, Axes]