tuning_curve#
- class braintools.visualize.tuning_curve(stimulus, response, bins=20, error_bars=True, fit_curve=None, ax=None, figsize=(10, 6), color='blue', alpha=0.7, xlabel='Stimulus', ylabel='Response', title=None, **kwargs)#
Plot tuning curve showing response vs stimulus.
- Parameters:
stimulus (
ndarray) – Stimulus values.response (
ndarray) – Neural response values.bins (
int|ndarray) – Number of bins or bin edges for averaging.error_bars (
bool) – Whether to show error bars (SEM).fit_curve (
str|None) – Type of curve to fit: ‘gaussian’, ‘polynomial’.ax (
Axes|None) – Axes to plot on.figsize (
Tuple[float,float]) – Figure size if creating new figure.color (
str) – Plot color.alpha (
float) – Alpha transparency.xlabel (
str) – Axis labels and title.ylabel (
str) – Axis labels and title.**kwargs – Additional arguments passed to plot.
- Returns:
ax – The axes object containing the plot.
- Return type:
Axes