From 8a59fa2836b037e6ae8b40be70ec7dfe2bbf3820 Mon Sep 17 00:00:00 2001 From: Anson Date: Mon, 20 Jan 2020 11:25:47 -0700 Subject: [PATCH] added calculated values to figure --- PlaneStress.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/PlaneStress.py b/PlaneStress.py index 39a9ef5..19c1fc6 100644 --- a/PlaneStress.py +++ b/PlaneStress.py @@ -54,8 +54,32 @@ class PlaneStress: x=2.5, y=2.6, text=f"\\tau_{{xy}} = {self.tau_xy}", render_mode="css" ) ) - plot.add_layout(Arrow(x_start=-2.5, y_start=2, x_end=-2.5, y_end=-2.2)) - plot.add_layout(Arrow(y_start=-2.5, x_start=2, y_end=-2.5, x_end=-2.2)) + + # Other calculations + plot.add_layout( + LatexLabel( + x=-1.8, + y=1.8, + text=f"\sigma_1 = {round(self.sigma_1,4)}", + render_mode="css", + ) + ) + plot.add_layout( + LatexLabel( + x=-1.8, + y=1.4, + text=f"\sigma_2 = {round(self.sigma_2,4)}", + render_mode="css", + ) + ) + plot.add_layout( + LatexLabel( + x=-1.8, + y=1, + text=f"\\tau_{{max}} = {round(self.tau_max,4)}", + render_mode="css", + ) + ) show(plot)