Skip to content

Commit

Permalink
Don't create a figure if error in umat.plot() (#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
adtzlr authored Feb 8, 2025
1 parent 7f40c66 commit 0fcab9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/felupe/constitution/_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0fcab9c

Please sign in to comment.