pybop.plotting.plot_parameters#

Module Contents#

Functions#

create_subplots_with_traces(traces[, plot_size, ...])

Create a subplot with individual traces for each parameter.

create_traces(params, trace_data[, x_values])

Create traces for plotting parameter evolution.

plot_parameters(optim[, xaxis_titles, yaxis_titles, title])

Plot the evolution of parameters during the optimization process using Plotly.

pybop.plotting.plot_parameters.create_subplots_with_traces(traces, plot_size=(1024, 576), title='Parameter Convergence', axis_titles=None, **layout_kwargs)[source]#

Create a subplot with individual traces for each parameter.

Parameters:
  • traces (list of plotly.graph_objs.Scatter) – Traces to be plotted, one trace per subplot.

  • plot_size (tuple of int, optional) – The size of the plot as (width, height), defaulting to (1024, 576).

  • title (str, optional) – The title of the plot, defaulting to “Parameter Convergence”.

  • axis_titles (list of tuple of str, optional) – A list of (x_title, y_title) pairs for each subplot. If None, titles are omitted.

  • **layout_kwargs (dict) – Additional keyword arguments to customize the layout.

Returns:

A Plotly figure object with subplots for each trace.

Return type:

plotly.graph_objs.Figure

pybop.plotting.plot_parameters.create_traces(params, trace_data, x_values=None)[source]#

Create traces for plotting parameter evolution.

Parameters:
  • params (list) – List of parameter objects, each having a ‘name’ attribute used for labeling the trace.

  • trace_data (list of numpy.ndarray) – A list of arrays representing the historical values of each parameter.

  • x_values (list or numpy.ndarray, optional) – The x-axis values for plotting. If None, defaults to sequential integers.

Returns:

A list of Scatter trace objects, one for each parameter.

Return type:

list of plotly.graph_objs.Scatter

pybop.plotting.plot_parameters.plot_parameters(optim, xaxis_titles='Iteration', yaxis_titles=None, title='Convergence')[source]#

Plot the evolution of parameters during the optimization process using Plotly.

Parameters:
  • optim (object) – The optimization object containing the history of parameter values and associated cost.

  • xaxis_titles (str, optional) – Title for the x-axis, defaulting to “Iteration”.

  • yaxis_titles (list of str, optional) – Titles for the y-axes, one for each parameter. If None, parameter names are used.

  • title (str, optional) – Title of the plot, defaulting to “Convergence”.

Returns:

A Plotly figure object showing the parameter evolution over iterations.

Return type:

plotly.graph_objs.Figure