Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Facilitate the creation of combined plots #777

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/sisl/viz/plots/merged.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,20 @@
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)

Check warning on line 43 in src/sisl/viz/plots/merged.py

View check run for this annotation

Codecov / codecov/patch

src/sisl/viz/plots/merged.py#L38-L43

Added lines #L38 - L43 were not covered by tests
else:
# This has to be a batch
figures_to_pass.extend(list(fig))

Check warning on line 46 in src/sisl/viz/plots/merged.py

View check run for this annotation

Codecov / codecov/patch

src/sisl/viz/plots/merged.py#L46

Added line #L46 was not covered by tests
else:
figures_to_pass.append(fig)

Check warning on line 48 in src/sisl/viz/plots/merged.py

View check run for this annotation

Codecov / codecov/patch

src/sisl/viz/plots/merged.py#L48

Added line #L48 was not covered by tests

plot_actions = combined(
*[fig.plot_actions for fig in figures],
*[fig.plot_actions for fig in figures_to_pass],
composite_method=composite_method,
**kwargs,
)
Expand Down