Plot Support classes

All plotters are based on an abstract plotter class that defines the fundamental plot features. Actual plotter classes are derived from that class and provide specific implementations of those features.

In addition, all Element classes inherit plot support methods from DrawElement.

Abstract Plotter class
class femedu.plotter.AbstractPlotter.AbstractPlotter

Defines all supported plot features. Implementation is required through derived classes.

addForces(axs)

add nodal forces to the plot shown in axs

Parameters:

axs – axis on which to plot

beamValuePlot(variable_name='', factor=0.0, file=None)

Create a traditional beam value plot, i.e., moment and shear diagrams.

If file is given, store the plot to that file. Use proper file extensions to indicate the desired format (.png, .pdf)

Parameters:
  • variable_name – string code for variable

  • factor – displacement scaling factor

  • file – filename (str)

displacementPlot(factor=1.0, file=None)

Create a deformed system plot

If file is given, store the plot to that file. Use proper file extensions to indicate the desired format (.png, .pdf)

Parameters:
  • factor – displacement magnification factor

  • file – filename (str)

setDisplacements(disp)
Parameters:

disp

setMesh(nodes, elems)

Link the nodes and elements so the ElementPlotter can get information from them.

Parameters:
  • nodes – list of node pointers

  • elements – list of element pointer

setNodalLoads(P)
Parameters:

P – list or tuple of nodal force vectors

setReactions(R)
Parameters:

R – list or tuple of nodal force vectors

setValues(vals)
Parameters:

vals

set_axes_equal(ax)

Make axes of 3D plot have equal scale so that spheres appear as spheres, cubes as cubes, etc.. This is one possible solution to Matplotlib’s ax.set_aspect(‘equal’) and ax.axis(‘equal’) not working for 3D.

Parameters:

ax – a matplotlib axis, e.g., as output from plt.gca().

Source of this method from: https://stackoverflow.com/questions/13685386/matplotlib-equal-unit-length-with-equal-aspect-ratio-z-axis-is-not-equal-to

valuePlot(variable_name='', deformed=False, file=None)

Create a plot using colors to identify magnitude of internal force.

If file is given, store the plot to that file. Use proper file extensions to indicate the desired format (.png, .pdf)

Parameters:
  • variable_name – string code for variable

  • deformed – True | False

  • file – filename (str)

Derived Classes