tilupy.plot
Functions
|
Plot shotgather image. |
|
Plot one or several heatmaps from a pandas DataFrame. |
Module Contents
Functions
- tilupy.plot.plot_shotgather(x: numpy.ndarray, t: numpy.ndarray, data: numpy.ndarray, xlabel: str = 'X (m)', ylabel: str = 'Time (s)', **kwargs) matplotlib.axes._axes.Axes
Plot shotgather image.
Plot shotgather like image, with vertical axis as time and horizontal axis and spatial dimension. This is a simple call to plot_shotgather, but input data is transposed because in tilupy the last axis is time by convention.
- Parameters:
x (numpy.ndarray) – Spatial coordinates, size NX.
t (numpy.ndarray) – Time array (assumed in seconds), size NT.
data (numpy.ndarray) – NX*NT array of data to be plotted.
xlabel (string, optional) – Label for x-axis, by default “X (m)”.
ylabel (string, optional) – Label for x-axis, by default “Time (s)”.
**kwargs (dict, optional) – parameters passed on to
pytopomap.plot.plot_imshow().
- Returns:
Axes instance where data is plotted
- Return type:
matplotlib.axes._axes.Axes
- tilupy.plot.plot_heatmaps(df, values, index, columns, aggfunc='mean', figsize=None, ncols=3, heatmap_kws=None, notations=None, best_values=None, plot_best_value='point', text_kwargs=None) matplotlib.figure.Figure
Plot one or several heatmaps from a pandas DataFrame.
Each heatmap is created by pivoting the DataFrame with the given index, columns, and a variable from values.
- Parameters:
df (pandas.DataFrame) – Input DataFrame containing the data.
values (list[str]) – Column names in
dfto plot as separate heatmaps.index (str) – Column name to use as rows of the pivot table.
columns (str) – Column name to use as columns of the pivot table.
aggfunc (str or callable, optional) – Aggregation function applied when multiple values exist for a given (index, column) pair. By default “mean”.
figsize (tuple of float, optional) – Size of the matplotlib figure, by default None.
ncols (int, optional) – Maximum number of heatmaps per row, by default 3.
heatmap_kws (dict or dict[dict], optional) – Keyword arguments passed to
seaborn.heatmap. If dict of dict, keys must match the values invalues.notations (dict, optional) – Mapping from variable names to readable labels (used for axis and colorbar labels).
best_values (dict, optional) – Mapping from variable names to selection criterion: “min”, “min_abs”, or “max”.
plot_best_value ({"point", "text"}, optional) – How to highlight best values: - “point” : mark with circles - “text” : display numeric values By default “point”.
text_kwargs (dict, optional) – Keyword arguments passed to
matplotlib.axes.Axes.textwhen annotating best values. Only used ifplot_best_value="text".
- Returns:
The matplotlib Figure containing the heatmaps.
- Return type:
matplotlib.figure.Figure