polartoolkit.plot_3d

Contents

polartoolkit.plot_3d#

plot_3d(grids, cmaps, exaggeration, drapegrids=None, view=(170, 30), vlims=None, region=None, hemisphere=None, epsg=None, shp_mask=None, shapefile=None, polygon_mask=None, colorbar=True, cbar_perspective=True, **kwargs)[source]#

create a 3D perspective plot of a list of grids

Parameters:
  • grids (list[DataArray] | DataArray) – xarray DataArrays to be plotted in 3D

  • cmaps (list[str] | str) – list of PyGMT colormap names to use for each grid

  • exaggeration (list[float] | float) – list of vertical exaggeration factors to use for each grid

  • view (tuple[float, float]) – tuple of azimuth and elevation angles for the view, by default [170, 30]

  • vlims (tuple[float, float] | None) – tuple of vertical limits for the plot, by default is z range of grids

  • region (tuple[float, float, float, float] | None) – region for the figure in format [xmin, xmax, ymin, ymax], by default None

  • hemisphere (str | None) – set whether to plot in “north” hemisphere (EPSG:3413) or “south” hemisphere (EPSG:3031), can be set manually, or will read from the environment variable: “POLARTOOLKIT_HEMISPHERE”

  • epsg (str | None) – set which EPSG projection to use for plotting, can be set manually, or will read from the environment variable: “POLARTOOLKIT_EPSG”, by default None

  • shp_mask (str | GeoDataFrame | None) – deprecated, use shapefile instead

  • shapefile (str | GeoDataFrame | None) – shapefile or geodataframe to clip the grids with, by default None

  • colorbar (bool) – whether to plot a colorbar, by default True

  • cbar_perspective (bool) – whether to plot the colorbar in perspective, by default True

  • drapegrids (list[DataArray] | None)

  • polygon_mask (list[float] | None)

  • kwargs (Any)

Returns:

Returns a figure object, which can be used by other PyGMT plotting functions.

Return type:

Figure