polartoolkit.Figure.add_grid

Contents

polartoolkit.Figure.add_grid#

Figure.add_grid(grid, cmap='viridis', shading=False, nan_transparent=True, colorbar=True, **kwargs)[source]#

Add a grid to the figure.

Parameters:
  • grid (str | DataArray) – Path to the grid file or an xarray DataArray containing the grid data.

  • cmap (str | bool) – Colormap to use for the grid, by default β€œviridis”. If True, last used colormap will be used.

  • shading (bool | str) – If True, apply shading to the grid. If a string, it will be passed to pygmt.grdshade as the shading argument. By default, False (no shading).

  • nan_transparent (bool) – If True, set NaN values to be transparent in the grid image. Default is True unless shading is False, in which case it is set to False.

  • colorbar (bool) – If True, add a colorbar to the figure. Default is True.

  • **kwargs (Any) – Additional keyword arguments to pass

Return type:

None