Skip to content

Commit f427b46

Browse files
Daniel-Nicolae23pre-commit-ci[bot]rtimms
authored
Plot voltage components bugfix (#5270)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Robert Timms <[email protected]>
1 parent f73e368 commit f427b46

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/pybamm/plotting/plot_voltage_components.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def plot_voltage_components(
3131
split_by_electrode : bool, optional
3232
Whether to show the overpotentials for the negative and positive electrodes
3333
separately. Default is False.
34+
electrode_phases : (str, str), optional
35+
The phases for which to plot the anode and cathode overpotentials, respectively.
36+
Default is `("primary", "primary")`.
3437
show_plot : bool, optional
3538
Whether to show the plots. Default is True. Set to False if you want to
3639
only display the plot after plt.show() has been called.

src/pybamm/simulation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,9 @@ def plot_voltage_components(
12701270
split_by_electrode : bool, optional
12711271
Whether to show the overpotentials for the negative and positive electrodes
12721272
separately. Default is False.
1273+
electrode_phases : (str, str), optional
1274+
The phases for which to plot the anode and cathode overpotentials, respectively.
1275+
Default is `("primary", "primary")`.
12731276
show_plot : bool, optional
12741277
Whether to show the plots. Default is True. Set to False if you want to
12751278
only display the plot after plt.show() has been called.
@@ -1285,7 +1288,7 @@ def plot_voltage_components(
12851288
ax=ax,
12861289
show_legend=show_legend,
12871290
split_by_electrode=split_by_electrode,
1288-
electrode_phases=("primary", "primary"),
1291+
electrode_phases=electrode_phases,
12891292
show_plot=show_plot,
12901293
**kwargs_fill,
12911294
)

0 commit comments

Comments
 (0)