galpynostatic.plot module

Plot helper for GalvanostaticRegressor object.

class galpynostatic.plot.GalvanostaticPlotter(greg)

Bases: object

GalvanostaticRegressor plot utilities.

Type of plots to produce:

  • ‘render_map’ : the map on which the data have been fitted.

  • ‘in_render_map’ : \(\Xi\) and \(\ell\) data points in the map.

  • ‘versus_data’ : predicted and actual maximum State-of-Charge (SOC) values versus galvanostatic charging rate (C-rate).

Parameters:

greg (galpynostatic.model.GalvanostaticRegressor) – An already fitted GalvanostaticRegressor model.

Notes

The map is only plotted in self.in_render_map(X) if ax is None, otherwise it is assumed to be already plotted and you just want to add the points to it, e.g. to compare different systems.

render_map(ax=None, clb=True, clb_label='maximum SOC')

Plot the map to which the data has been fitted.

Parameters:
  • ax (matplotlib.axes.Axes, default=None) – The current axes.

  • clb (bool, default=True) – Add the colorbar to the plot.

  • clb_label (str, default="maximum SOC") – The label for the colorbar.

Returns:

ax – The current axes.

Return type:

matplotlib.axes.Axes

in_render_map(X, ax=None, **kwargs)

Plot showing in which region of the map the fit is found.

Parameters:
  • X (array-like of shape (n_measurements, 1)) – C-rate data from the experiments.

  • ax (matplotlib.axes.Axes, default=None) – The current matplotlib axes.

  • **kwargs – Additional keyword arguments that are passed and are documented in matplotlib.axes.Axes.plot

Returns:

ax – The current axes.

Return type:

matplotlib.axes.Axes

versus_data(X, y, X_eval=None, ax=None, data_kws=None, pred_kws=None)

Plot SOC predictions versus target data as a function of the C-rate.

Parameters:
  • X (array-like of shape (n_measurements, 1)) – C-rates data of the experiments.

  • y (array-like of shape (n_measurements,)) – Target maximum SOC values.

  • X_eval (array-like of shape (n_measurements, 1), default=None.) – C-rates values to evaluate the model and compare it with the data. If set to None, it will evaluate 250 points between the maximum and minimum of X.

  • ax (matplotlib.axes.Axes, default=None) – The current axes.

  • data_kws (dict, default=None) – Additional keyword arguments that are passed and are documented in matplotlib.axes.Axes.plot for the data points.

  • pred_kws (dict, default=None) – Additional keyword arguments that are passed and are documented in matplotlib.axes.Axes.plot for the prediction values.

Returns:

ax – The current axes.

Return type:

matplotlib.axes.Axes