From 0fcab9cc52f7890fdca664e703e369f27c0c30e6 Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Sat, 8 Feb 2025 08:28:45 +0100 Subject: [PATCH] Don't create a figure if error in `umat.plot()` (#934) --- src/felupe/constitution/_view.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/felupe/constitution/_view.py b/src/felupe/constitution/_view.py index 5a34932e..2ac94cba 100644 --- a/src/felupe/constitution/_view.py +++ b/src/felupe/constitution/_view.py @@ -72,11 +72,12 @@ def plot(self, ax=None, show_title=True, show_kwargs=True, **kwargs): shear and biaxial tension.""" import matplotlib.pyplot as plt + + data = self.evaluate() if ax is None: fig, ax = plt.subplots() - data = self.evaluate() for stretch, force, label in data: ax.plot(stretch, force, label=label, **kwargs)