anaStruct icon indicating copy to clipboard operation
anaStruct copied to clipboard

Overlaying displacement plots

Open fazaghifari opened this issue 2 years ago • 1 comments

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

fazaghifari avatar Jun 16 '23 13:06 fazaghifari

@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.

brookshsmith avatar Aug 28 '23 12:08 brookshsmith