Plotting

Visualisation functions for inspecting model inputs and outputs.

bayesian_listener.plotting.plot_cues(bl, title='', fig=None, ax=None, clim=None, elev_min=None)[source]

Plot spectral cues on the median plane.

Parameters:
  • bl (BayesianListener) – Listener instance with target already set.

  • title (str, default='') – String appended to the default subplot title.

  • fig (matplotlib.figure.Figure or None, default=None) – Existing figure to plot on. None creates a fresh figure.

  • ax (matplotlib.axes.Axes or None, default=None) – Existing axes to plot on. None creates fresh axes inside fig.

  • clim (tuple of float or None, default=None) – (vmin, vmax) for the colour scale in dB. None uses (amps.min(), amps.max()).

  • elev_min (float or None, default=None) – Drop directions with elevation below this threshold (degrees). None keeps all directions on the median plane.

Returns:

Raises:

ValueError – If target is None.

bayesian_listener.plotting.plot_post(bl, posterior, estimations)[source]

Plot the posterior distribution on the sphere with response overlay.

Parameters:
  • bl (BayesianListener) – Listener instance with template already set.

  • posterior (numpy.ndarray) – Log-posterior of shape (n_templates,), e.g. one slice of infer output with store_posterior=True.

  • estimations (pyfar.Coordinates or None) – Optional pointing-response coordinate (single direction). If None, only the posterior is drawn.

Returns:

ax – 3-D axes with the posterior scatter and overlay arrows.

Return type:

matplotlib.axes.Axes