polartoolkit.plot_data

Contents

polartoolkit.plot_data#

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

Show sampled data on a cross section, with an optional location map.

Parameters:
  • method (str) โ€“ Choose sampling method, either โ€œpointsโ€, โ€œshapefileโ€, or โ€œpolylineโ€

  • data_dict (dict, optional) โ€“ 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.

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

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

  • hemisphere (str, optional,) โ€“ set projection based on โ€œnorthโ€ or โ€œsouthโ€ hemispheres, by default None

  • epsg (str | None, optional) โ€“ set projection from EPSG code string (โ€œ3031โ€), by default None

  • kwargs (Any)

Keyword Arguments:
  • 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.

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

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

  • 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]

Returns:

  • fig (pygmt.Figure) โ€“ a PyGMT figure object with the profile data plotted.

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