pybop.plot.util#
Functions#
|
Get instance of PlotBackend class for a given plotting backend |
|
Get instance of PlotBackend class from a provided figure or from a specified backend. |
|
Check the type and dimensions of the data and convert if necessary to a list |
Remove square brackets from a string and replace with forward slashes |
|
|
Select a plotting backend to be used for all subsequent plots. |
|
Wrap text to a specified width with HTML line breaks. |
Module Contents#
- pybop.plot.util.get_backend(backend=None)[source]#
Get instance of PlotBackend class for a given plotting backend
- Parameters:
backend (str or pybop.plot.backends.PlotBackend, optional) – The plotting backend to be used (default: pybop.plot.current_backend)
- pybop.plot.util.get_backend_from_figure(backend=None, figures=None)[source]#
Get instance of PlotBackend class from a provided figure or from a specified backend. If both are provided, the figure’s backend takes precedence.
- Parameters:
backend (str or pybop.plot.backends.PlotBackend, optional) – The plotting backend to be used (default: pybop.plot.current_backend)
figures (figure object, optional) – Figure for plotting. If not provided a new figure is created
- Returns:
Instance of the selected plotting backend.
- Return type:
- pybop.plot.util.parse_data(x, y)[source]#
Check the type and dimensions of the data and convert if necessary to a list of ‘things plotly can take’, e.g. numpy arrays or lists of numbers.
- Parameters:
x (list or np.ndarray, optional) – X-axis data points.
y (list or np.ndarray, optional) – Primary Y-axis data points for simulated model output.
- pybop.plot.util.remove_brackets(s)[source]#
Remove square brackets from a string and replace with forward slashes as per section 7.1 of the SI Handbook
- pybop.plot.util.use_backend(backend)[source]#
Select a plotting backend to be used for all subsequent plots.
- Parameters:
backend (str or pybop.plot.backends.PlotBackend) – The plotting backend to be used.