pybop.plot.trajectories#

Functions#

trajectories(x, y[, title, xaxis_title, yaxis_title, ...])

Quickly plot one or more trajectories.

Module Contents#

pybop.plot.trajectories.trajectories(x, y, title: str = None, xaxis_title: str = None, yaxis_title: str = None, labels=None, label_width=20, show=True, backend=None, figures=None, axes=None)[source]#

Quickly plot one or more trajectories.

Parameters:
  • x (list or np.ndarray) – X-axis data points.

  • y (list or np.ndarray) – Y-axis data points for each trajectory.

  • title (str, optional) – The title of the figure

  • xaxis_title (str, optional) – Sets the title/label of the x-axis

  • yaxis_title (str, optional) – Sets the title/label of the y-axis Settings to modify the default trace type (default: DEFAULT_TRACE_OPTIONS).

  • labels (list or str, optional) – Name(s) for the trace(s) (default: None).

  • label_width (int, optional) – Maximum length of the labels before text wrapping is used (default: 20).

  • show (bool, optional) – If True, the figure is shown upon creation (default: True).

  • backend (str or pybop.plot.backends.PlotBackend, optional) – The plotting backend to be used.

  • figures (figure object, optional) – Figure for plotting. If not provided a new figure is created

  • axes (axis, optional) – Thes axis to be used for plotting plotly: axis expected to be of the form tuple(row, col)

Returns:

  • fig (if show is False; plotly.graph_objs.Figure or matplotlib.figure.Figure)

  • None (if show is True)