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: