diff --git a/trussme/truss.py b/trussme/truss.py index 9d26d2c..4ce10d3 100644 --- a/trussme/truss.py +++ b/trussme/truss.py @@ -97,9 +97,7 @@ def fos_yielding(self) -> float: @property def fos_buckling(self) -> float: """float: Smallest buckling FOS of any member in the truss""" - return min( - [m.fos_buckling if m.fos_buckling > 0 else numpy.inf for m in self.members] - ) + return min([m.fos_buckling for m in self.members]) @property def fos(self) -> float: diff --git a/trussme/visualize.py b/trussme/visualize.py index 828f2a2..b621518 100644 --- a/trussme/visualize.py +++ b/trussme/visualize.py @@ -51,7 +51,7 @@ def plot_truss( force_colormap = matplotlib.colors.LinearSegmentedColormap.from_list( "force", - numpy.array([[1.0, 0.0, 0.0], [0.7, 0.7, 0.7], [0.0, 0.0, 1.0]]), + numpy.array([[1.0, 0.0, 0.0], [0.8, 0.8, 0.8], [0.0, 0.0, 1.0]]), ) for member in truss.members: @@ -81,7 +81,7 @@ def plot_truss( else "r" ) elif deflected_shape == "force": - color = matplotlib.pyplot.cm.bwr(member.force / (2 * scaler) + 0.5) + color = force_colormap(member.force / (2 * scaler) + 0.5) elif deflected_shape is None: break else: