polartoolkit.plot_profile

Contents

polartoolkit.plot_profile#

plot_profile(method, layers_dict=None, data_dict=None, add_map=False, layers_version=None, fig_height=9, fig_width=14, hemisphere=None, epsg=None, **kwargs)[source]#

Show sampled layers and/or data on a cross section, with an optional location map.

Parameters:
  • method (str) – Choose sampling method, either “points”, “shapefile”, or “polyline”

  • layers_dict (dict[Any, Any] | None) – nested dictionary of layers to include in cross-section, construct with ptk.make_data_dict, by default is created from Bedmap2, Bedmap3, or Bedmachine data, as chosen from layers_version.

  • data_dict (Any | None) – nested dictionary of data to include in option graph, construct with ptk.make_data_dict, by default is gravity and magnetic anomalies.

  • add_map (bool) – Choose whether to add a location map, by default is False.

  • layers_version (str | None) – choose between using ‘bedmap2’, ‘bedmap3’ or ‘bedmachine’ layers, the default for Antarctica is Bedmap3 and for Greenland is BedMachine.

  • fig_height (float) – Set the height of the figure (excluding the map) in cm, by default is 9.

  • fig_width (float) – Set the width of the figure (excluding the map) in cm, by default is 14.

  • hemisphere (str | None) – set projection based on “north” or “south” hemispheres, by default None

  • epsg (str | None) – set projection from EPSG code string (“3031”), by default None

  • kwargs (Any)

Keyword Arguments:
  • default_layers_spacing (float) – Spacing to use for layers grid, by default, if profile is longer than 2000 km, will use 5 km for faster plotting, or else it will default to the grids’ native resolution.

  • default_layers_reference (str) – Vertical reference frame to use for elevation grids, by default uses defaults from fetch functions for layers_version.

  • fillnans (bool) – Choose whether to fill nans in layers, defaults to True.

  • num (int) – Number of points to sample at along a line.

  • max_dist (int) – Clip all distances greater than.

  • min_dist (int) – Clip all distances less than.

  • map_background (str or xarray.DataArray) – Change the map background by passing a filename string or grid, by default is imagery.

  • map_cmap (str) – Change the map colorscale by passing a valid GMT cmap string, by default is ‘viridis’.

  • map_buffer (float) – Change map zoom as relative percentage of profile length (0-1), by default is 0.3.

  • layer_buffer (float) – Change vertical white space within cross-section (0-1), by default is 0.1.

  • data_buffer (float) – Change vertical white space within data graph (0-1), by default is 0.1.

  • layers_legend_loc (str) – Change the legend location with a GMT position string, by default is “JBR+jBL+o0c”.

  • data_legend_loc (str) – Change the legend location with a GMT position string, by default is “JBR+jBL+o0c”.

  • layers_legend_columns (int) – Change the number of columns in the legend, by default is 1.

  • inset (bool) – choose to plot inset map showing figure location, by default is True

  • inset_position (str) – position for inset map with PyGMT syntax, by default is “jTL+jTL+o0/0”

  • save (bool) – Choose to save the image, by default is False.

  • path (str) – Filename for saving image, by default is None.

Return type:

tuple[Figure, DataFrame, DataFrame]

Returns:

  • fig (pygmt.Figure) – a PyGMT figure object with the cross-section and data plotted.

  • df_layers (pandas.DataFrame) – DataFrame with sampled layers along the cross-section.

  • df_data (pandas.DataFrame) – DataFrame with sampled data along the cross-section, if data_dict is None, this will be an empty DataFrame.