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

Overlaying displacement plots #162

Open
fazaghifari opened this issue Jun 16, 2023 · 1 comment
Open

Overlaying displacement plots #162

fazaghifari opened this issue Jun 16, 2023 · 1 comment

Comments

@fazaghifari
Copy link

Hello,

Are there any commands or functions in Anastruct that allows to:

  1. Plot displacement with a color other than blue?
  2. Overlays two (or more) different displacement plots of the same structure?

Does anyone have any ideas to work around this problem if such commands are not available?

Cheers!
Adam

@smith120bh
Copy link
Collaborator

smith120bh commented Aug 28, 2023

@fazaghifari : No, we've not provided a way to customise the plots at this time; I'll mark this as an enhancement request, but unless you or someone else would like to add this functionality (I'd love more contributors!), it's probably not high on my priorities personally...

However, I can give you a bit of a workaround, and that's that most of anaStruct's internal variables are freely accessible to you. Once you've solved your system (say, in a variable called system), you can pull all the displacement data for each individual element as follows:

for element in system.element_map.values():
  element_displacement = (
      np.linspace(
          element.node_1.uz,
          element.node_2.uz,
          num=len(element.deflection),
      )
      + element.deflection
  )

You'd probably want to collect those displacements from every element, and plot them together using matplotlib or any other plotter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants