tilupy.plot =========== .. py:module:: tilupy.plot Functions --------- .. autoapisummary:: tilupy.plot.plot_shotgather tilupy.plot.plot_heatmaps Module Contents --------------- Functions ^^^^^^^^^ .. py:function:: 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. :param x: Spatial coordinates, size NX. :type x: numpy.ndarray :param t: Time array (assumed in seconds), size NT. :type t: numpy.ndarray :param data: NX*NT array of data to be plotted. :type data: numpy.ndarray :param xlabel: Label for x-axis, by default "X (m)". :type xlabel: string, optional :param ylabel: Label for x-axis, by default "Time (s)". :type ylabel: string, optional :param \*\*kwargs: parameters passed on to :func:`pytopomap.plot.plot_imshow`. :type \*\*kwargs: dict, optional :returns: Axes instance where data is plotted :rtype: matplotlib.axes._axes.Axes .. py:function:: 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`. :param df: Input DataFrame containing the data. :type df: pandas.DataFrame :param values: Column names in :data:`df` to plot as separate heatmaps. :type values: list[str] :param index: Column name to use as rows of the pivot table. :type index: str :param columns: Column name to use as columns of the pivot table. :type columns: str :param aggfunc: Aggregation function applied when multiple values exist for a given (index, column) pair. By default "mean". :type aggfunc: str or callable, optional :param figsize: Size of the matplotlib figure, by default None. :type figsize: tuple of float, optional :param ncols: Maximum number of heatmaps per row, by default 3. :type ncols: int, optional :param heatmap_kws: Keyword arguments passed to :data:`seaborn.heatmap`. If dict of dict, keys must match the values in :data:`values`. :type heatmap_kws: dict or dict[dict], optional :param notations: Mapping from variable names to readable labels (used for axis and colorbar labels). :type notations: dict, optional :param best_values: Mapping from variable names to selection criterion: "min", "min_abs", or "max". :type best_values: dict, optional :param plot_best_value: How to highlight best values: - "point" : mark with circles - "text" : display numeric values By default "point". :type plot_best_value: {"point", "text"}, optional :param text_kwargs: Keyword arguments passed to :data:`matplotlib.axes.Axes.text` when annotating best values. Only used if :data:`plot_best_value="text"`. :type text_kwargs: dict, optional :returns: The matplotlib Figure containing the heatmaps. :rtype: matplotlib.figure.Figure