dianna.visualization.timeseries =============================== .. py:module:: dianna.visualization.timeseries Functions --------- .. autoapisummary:: dianna.visualization.timeseries.plot_timeseries dianna.visualization.timeseries._draw_segments dianna.visualization.timeseries._process_plotting_parameters Module Contents --------------- .. py:function:: plot_timeseries(x: numpy.ndarray, y: numpy.ndarray, segments: List[Dict[str, Any]], x_label: str = 't', y_label: Union[str, Iterable[str]] = None, cmap: Optional[str] = 'bwr', show_plot: Optional[bool] = True, output_filename: Optional[str] = None, heatmap_range=(-1, 1)) -> matplotlib.pyplot.Figure Plot timeseries with segments highlighted. :param x: X-values with shape (number of time_steps) :type x: np.ndarray :param y: Y-values with shape (number_of_time_steps, number_of_channels) :type y: np.ndarray :param segments: Segment data, must be a list of dicts with the following keys: 'index', 'start', 'end', 'weight', 'channel. Here, `index` is the index of the segment of feature, `start` and `end` determine the location of the segment, `weight` determines the color, and 'channel' determines the channel within the timeseries. :type segments: List[Dict[str, Any]] :param x_label: Label for the x-axis :type x_label: str, optional :param y_label: Label or list of labels for the y-axis :type y_label: Union[str, Iterable[str]], optional :param cmap: Matplotlib colormap :type cmap: str, optional :param show_plot: Shows plot if true (for testing or writing plots to disk instead). :type show_plot: bool, optional :param output_filename: Name of the file to save the plot to (optional). :type output_filename: str, optional :param heatmap_range: a tuple (vmin, vmax) to set the range of the heatmap. :type heatmap_range: tuple, optional :returns: plt.Figure .. py:function:: _draw_segments(axs, cmap, segments, heatmap_range) .. py:function:: _process_plotting_parameters(x, y, y_labels)