Skip to content

Commit 4b61570

Browse files
Add documentation to fig,ax return in plot functions; no need to change examples
1 parent f702974 commit 4b61570

File tree

6 files changed

+140
-33
lines changed

6 files changed

+140
-33
lines changed

sectionproperties/analysis/cross_section.py

Lines changed: 131 additions & 29 deletions
Large diffs are not rendered by default.

sectionproperties/examples/example_composite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
section.display_results()
4545

4646
# plot the centroids
47-
fig, ax = section.plot_centroids()
47+
section.plot_centroids()
4848

4949
stress_post.plot_stress_n_zz(pause=False) # plot the axial stress
5050
stress_post.plot_stress_m_zz(pause=False) # plot the bending stress

sectionproperties/examples/example_custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
section.calculate_plastic_properties()
3434

3535
# plot the centroids
36-
fig, ax = section.plot_centroids()
36+
section.plot_centroids()

sectionproperties/examples/example_merged.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
section.calculate_plastic_properties(time_info=True, verbose=True)
4040

4141
# plot the centroids
42-
fig, ax = section.plot_centroids()
42+
section.plot_centroids()

sectionproperties/examples/example_mirr_rot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
section.calculate_plastic_properties(time_info=True, verbose=True)
3434

3535
# plot the centroids
36-
fig, ax = section.plot_centroids()
36+
section.plot_centroids()

sectionproperties/pre/sections.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ def plot_geometry(self, ax=None, pause=True, labels=False, perimeter=False):
256256
:param bool labels: If set to true, node and facet labels are displayed
257257
:param bool perimeter: If set to true, boldens the perimeter of the cross-section
258258
259+
:return: Matplotlib figure and axes objects (fig, ax)
260+
:rtype: (:class:`matplotlib.figure.Figure`, :class:`matplotlib.axes`)
261+
259262
The following example creates a CHS discretised with 64 points, with a diameter of 48 and
260263
thickness of 3.2, and plots the geometry::
261264
@@ -334,6 +337,8 @@ def plot_geometry(self, ax=None, pause=True, labels=False, perimeter=False):
334337
if not ax_supplied:
335338
post.finish_plot(ax, pause, title='Cross-Section Geometry')
336339

340+
return (fig, ax)
341+
337342
def calculate_extents(self):
338343
"""Calculates the minimum and maximum x and y-values amongst the list of points.
339344

0 commit comments

Comments
 (0)