From 11592301fed7c623b197612708e297dd88471e53 Mon Sep 17 00:00:00 2001 From: rasmusthog Date: Sun, 9 Oct 2022 18:39:37 +0200 Subject: [PATCH] Allow passing of own Axes-object --- nafuma/electrochemistry/plot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nafuma/electrochemistry/plot.py b/nafuma/electrochemistry/plot.py index 8fbee49..f8ef088 100644 --- a/nafuma/electrochemistry/plot.py +++ b/nafuma/electrochemistry/plot.py @@ -68,7 +68,12 @@ def plot_gc(data, options=None): if options['show_plot']: # Prepare plot - fig, ax = btp.prepare_plot(options=options) + + if not options['fig'] and not options['ax']: + fig, ax = btp.prepare_plot(options=options) + else: + fig, ax = options['fig'], options['ax'] + for i, cycle in enumerate(data['cycles']): if i in options['which_cycles']: if options['charge']: