***************************** :py:mod:`wildboar.utils.plot` ***************************** .. py:module:: wildboar.utils.plot .. autoapi-nested-parse:: Plotting utilities. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: wildboar.utils.plot.plot_frequency_domain wildboar.utils.plot.plot_time_domain .. raw:: html
.. py:function:: plot_frequency_domain(x, y=None, *, ax=None, n_samples=100, jitter=False, spectrum='amplitude', sample_spacing=1, bins=None, cmap='Dark2') Plot the samples in the frequency domain. :Parameters: **x** : array-like of shape (n_sample, n_timestep) The samples. **y** : array-like of shape (n_samples, ), optional The labels. **ax** : Axes, optional The matplotlib Axes-object. **n_samples** : int, optional The maximum number of samples to plot. If n_samples is larger than the number of samples in x or None, all samples are plotted. **jitter** : bool, optional Add jitter to the amplitude lines. **spectrum** : {"amplitude", "phase"}, optional The spectrum. **sample_spacing** : int, optional The frequency domain sample spacing. **bins** : bool, optional Show the frequency bins. **cmap** : str, optional The colormap. :Returns: Axes The axes object that has been plotted. .. rubric:: Examples >>> from wildboar.utils.plot import plot_frequency_domain >>> from wildboar.datasets import load_gun_point >>> X, y = load_gun_point() >>> plot_frequency_domain(X, y, n_sample=10) .. !! processed by numpydoc !! .. py:function:: plot_time_domain(x, y=None, *, n_samples=100, ax=None, alpha=0.5, linewidth=0.5, zorder=-1, cmap='Dark2', show_legend=8) Plot the samples in the time domain. :Parameters: **x** : array-like of shape (n_sample, n_timestep) The samples. **y** : array-like of shape (n_samples, ), optional The labels, assumed to be discrete labels. **n_samples** : int, optional The maximum number of samples to plot. If n_samples is larger than the number of samples in x or None, all samples are plotted. **ax** : Axes, optional The matplotlib Axes-object. **alpha** : float, optional The opacity of the samples. **linewidth** : float, optional The width of the sample lines. **zorder** : int, optional The order where the samples are plotted. By default we plot the samples at -1. **cmap** : str, optional The colormap used to colorize samples according to its label. **show_legend** : bool or int, optional Whether the legend of labels are show. - if bool, show the legend if y is not None - if int, show the legend if the number of labels are lower than the show_legend parameter value :Returns: Axes The axes object that has been plotted. .. rubric:: Examples >>> from wildboar.utils.plot import plot_time_domain >>> from wildboar.datasets import load_gun_point >>> X, y = load_gun_point() >>> plot_time_domain(X, y, n_sample=10) .. !! processed by numpydoc !!