From ce82efb9c64fac21500029733997df7f0f81050a Mon Sep 17 00:00:00 2001 From: Pol Febrer Date: Sat, 25 May 2024 17:37:47 +0200 Subject: [PATCH] Support batches when merging plots --- src/sisl/viz/plots/merged.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/sisl/viz/plots/merged.py b/src/sisl/viz/plots/merged.py index 5086f0dc95..a9077f3b53 100644 --- a/src/sisl/viz/plots/merged.py +++ b/src/sisl/viz/plots/merged.py @@ -35,8 +35,20 @@ def merge_plots( which controls the arrangement ("rows", "cols" or "square"). """ + figures_to_pass = [] + for fig in figures: + if isinstance(fig, Plot): + fig = fig.get() + if isinstance(fig, Figure): + figures_to_pass.append(fig) + else: + # This has to be a batch + figures_to_pass.extend(list(fig)) + else: + figures_to_pass.append(fig) + plot_actions = combined( - *[fig.plot_actions for fig in figures], + *[fig.plot_actions for fig in figures_to_pass], composite_method=composite_method, **kwargs, )