matplotlib. Install it with:
pybamm.QuickPlot
Generates a grid of subplots for a set of output variables from one or more solutions.
A single or list of
pybamm.Solution or pybamm.Simulation objects to plot.Variables to include in the plot. Defaults to a model-specific set of key outputs.
Legend labels for each solution. Defaults to the model names.
Colour cycle to use. Defaults to the active matplotlib style.
Linestyle cycle.
Shading mode for 2D (pcolormesh) panels.
Figure size in inches, forwarded to
plt.figure.Number of subplot rows. If
None, a square-ish layout is used.Time axis unit:
"hours", "minutes", or "seconds".Spatial axis unit:
"m", "mm", or "um".Axis / colorbar limits.
"fixed": axes do not move as time progresses."tight": axes rescale at each time step.dict: per-variable control, e.g.{"Terminal voltage [V]": (3.0, 4.2)}.
Number of linearly-spaced time points added per sub-solution (when Hermite interpolation is available).
pybamm.dynamic_plot
Open an interactive slider plot.
QuickPlot. Returns the QuickPlot instance.
pybamm.plot
Convenience wrapper — equivalent to pybamm.QuickPlot(solutions, ...).plot(t=0) followed by plt.show().
pybamm.plot2D
Generate a filled contour (contourf) plot of a 2D PyBaMM array.
Array for the x-axis. Shape
(M, N) or (N, 1).Array for the y-axis. Shape
(M, N) or (M, 1).Array for the z-axis (colour values). Shape
(M, N).Axis to plot on. If
None, a new figure is created.Whether to call
plt.show(). Set to False when embedding in a larger figure.pybamm.plot_voltage_components
Decomposes the terminal voltage into its constituent overpotentials and plots them as stacked filled areas.
Solved simulation or solution object.
Axis to draw on. Creates a new figure if
None.Whether to show the legend.
Show separate overpotentials for the negative and positive electrodes.
Phase labels for composite-electrode models.
Whether to call
plt.show().pybamm.plot_summary_variables
Plot summary variables (capacity fade, lithium inventory loss, etc.) across multiple cycles.
One or more solutions from a multi-cycle experiment.
Variables to plot. Defaults to capacity, lithium inventory, active material loss, and stoichiometry limits.
Legend labels for each solution.
Whether to call
plt.show().output_variables:
"Capacity [A.h]""Loss of lithium inventory [%]""Total capacity lost to side reactions [A.h]""Loss of active material in negative electrode [%]""Loss of active material in positive electrode [%]""x_100","x_0","y_100","y_0"