From afbea864e648f1ede3790694ad0b0463a9b6289c Mon Sep 17 00:00:00 2001 From: BenWillemsen <32103702+BenWillemsen@users.noreply.github.com> Date: Wed, 31 Jan 2024 14:02:18 +0100 Subject: [PATCH] Fix bug in drawing.py matplotlib is imported lazily but was also checked for raising an importerror when .draw was called from shell. --- pyzx/drawing.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyzx/drawing.py b/pyzx/drawing.py index 2933b6ea..1c619141 100644 --- a/pyzx/drawing.py +++ b/pyzx/drawing.py @@ -58,8 +58,6 @@ def draw(g: Union[BaseGraph[VT,ET], Circuit], labels: bool=False, **kwargs) -> A labels = labels or settings.show_labels if get_mode() == "shell": - if plt is None: - raise ImportError("This function requires matplotlib.") return draw_matplotlib(g, labels, **kwargs) elif get_mode() == "browser": return draw_d3(g, labels, **kwargs)