bycycle.plts.plot_feature_hist

bycycle.plts.plot_feature_hist(feature, param_label, only_bursts=True, bins='auto', ax=None, **kwargs)[source]

Plot a histogram for a cycle feature.

Parameters:
featurepandas.DataFrame or 1d array

Dataframe output from compute_features() or a 1d array.

param_labelstr

Column name of the parameter of interest in df_features.

only_burstbool, optional, default: True

Whether to limit cycles to only those that are bursting.

binsint or string, optional, default: ‘auto’

The number of bins or binning strategy, as specified in matplotlib.pyplot.hist.

axmatplotlib.Axes, optional

Figure axes upon which to plot.

**kwargs

Keyword arguments to pass into matplotlib.pyplot.hist.

Notes

Default keyword arguments include:

  • xlabel: str, default: param_label

  • figsize: tuple of (float, float), default: (10, 10)

  • color: str, default: ‘k’

  • xlim: tuple of (float, float), default: None

  • fontsize: float, default: 15

  • alpha: float, default: .5

Examples

Plot a histogram of each cycle’s mean band amplitude:

>>> from bycycle.features import compute_features
>>> from neurodsp.sim import sim_bursty_oscillation
>>> fs = 500
>>> sig = sim_bursty_oscillation(10, fs, freq=10)
>>> df_features = compute_features(sig, fs, f_range=(8, 12), return_samples=False)
>>> plot_feature_hist(df_features, 'band_amp', only_bursts=False)

Examples using bycycle.plts.plot_feature_hist

1. Theta oscillation cycle feature distributions

1. Theta oscillation cycle feature distributions

3. MNE Interface Cycle Feature Distributions

3. MNE Interface Cycle Feature Distributions

4. PAC Cycle Feature Distributions

4. PAC Cycle Feature Distributions