Plot Centroids#

This example demonstrates how to plot centroids in sectionproperties.

The plot_centroids() method will display a plot of the finite element mesh along with any centroids that have been calculated:

  • Geometric analysis - geometric centroid and principal axes

  • Warping analysis - shear centre

  • Plastic analysis - plastic centroid

This example will plot the centroids for a 200 mm deep and 12 mm thick bulb section with a 10 mm radius.

[1]:
from sectionproperties.analysis import Section
from sectionproperties.pre.library import bulb_section


geom = bulb_section(d=200, b=50, t=12, r=10, n_r=8)
geom.create_mesh(mesh_sizes=20)
sec = Section(geometry=geom)
sec.plot_mesh(materials=False)
../../_images/examples_results_plot_centroids_3_0.svg
[1]:
<Axes: title={'center': 'Finite Element Mesh'}>

Geometric Analysis#

[2]:
sec.calculate_geometric_properties()
sec.plot_centroids()
../../_images/examples_results_plot_centroids_5_0.svg
[2]:
<Axes: title={'center': 'Centroids'}>

Warping Analysis#

Note that the title and transparency can be changed by specifying title and alpha respectively.

[3]:
sec.calculate_warping_properties()
sec.plot_centroids(title="Geometric & Warping Centroids", alpha=0.2)
../../_images/examples_results_plot_centroids_7_0.svg
[3]:
<Axes: title={'center': 'Geometric & Warping Centroids'}>

Plastic Analysis#

[4]:
sec.calculate_plastic_properties()
sec.plot_centroids()
../../_images/examples_results_plot_centroids_9_0.svg
[4]:
<Axes: title={'center': 'Centroids'}>