Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix show_results() plotting #218

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions anastruct/fem/plotter/mpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ def axial_force(
el.N_2,
node_results=not bool(verbosity),
color=color,
axes_i=axes_i,
)

point = (el.vertex_2 - el.vertex_1) / 2 + el.vertex_1
Expand Down Expand Up @@ -933,6 +934,7 @@ def bending_moment(
abs(el.node_1.Ty),
abs(el.node_2.Ty),
node_results=node_results,
axes_i=axes_i,
)

if el.all_qp_load:
Expand Down Expand Up @@ -1009,7 +1011,11 @@ def shear_force(
shear_2 = el.shear_force[-1]

self.plot_result(
axis_values, shear_1, shear_2, node_results=not bool(verbosity)
axis_values,
shear_1,
shear_2,
node_results=not bool(verbosity),
axes_i=axes_i,
)
if show:
self.plot()
Expand Down Expand Up @@ -1203,7 +1209,12 @@ def displacements( # pylint: disable=arguments-renamed

for el in self.system.element_map.values():
axis_values = plot_values_deflection(el, factor, linear)
self.plot_result(axis_values, node_results=False, fill_polygon=False)
self.plot_result(
axis_values,
node_results=False,
fill_polygon=False,
axes_i=axes_i,
)

if el.type == "general":
assert el.deflection is not None
Expand Down Expand Up @@ -1264,6 +1275,7 @@ def results_plot(
axes_i=0,
)
self.axes.append(self.fig.add_subplot(a + 2))
print(self.axes)
plt.title("bending moment")
self.bending_moment(
factor=None,
Expand Down