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 (
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.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 Noneepsg (
str|None) โ set projection from EPSG code string (โ3031โ), by default Nonekwargs (
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:
- 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.