brainmass.viz.plot_phase_portrait

brainmass.viz.plot_phase_portrait#

brainmass.viz.plot_phase_portrait(x, y, *, ax=None, **kwargs)[source]#

Plot a phase portrait of one variable against another.

Parameters:
  • x (array_like or brainunit.Quantity) – The two trajectories (same length). Units are stripped for plotting.

  • y (array_like or brainunit.Quantity) – The two trajectories (same length). Units are stripped for plotting.

  • ax (matplotlib.axes.Axes, optional) – Axes to draw on. A new figure/axes is created when None.

  • **kwargs – Forwarded to matplotlib.axes.Axes.plot().

Returns:

The axes drawn on.

Return type:

matplotlib.axes.Axes

See also

plot_timeseries

plot variables against time.

Examples

>>> import numpy as np
>>> import brainmass
>>> t = np.linspace(0, 6, 100)
>>> ax = brainmass.viz.plot_phase_portrait(np.sin(t), np.cos(t))
>>> ax.get_xlabel()
'x'