Skip to content

Commit 359cc43

Browse files
Merge pull request #235 from Agent6-6-6/master
Fix legend formatting
2 parents a154afa + 5a336ab commit 359cc43

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sectionproperties/post/post.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,15 @@ def plotting_context(
6060

6161
yield fig, ax
6262

63-
ax.set_aspect("equal", anchor="C")
6463
ax.set_title(title)
64+
plt.tight_layout()
65+
ax.set_aspect("equal", anchor="C")
6566

67+
# if no axes was supplied, finish the plot and return the figure and axes
6668
if ax_supplied:
6769
# if an axis was supplied, don't continue with displaying or configuring the plot
6870
return
6971

70-
# if no axes was supplied, finish the plot and return the figure and axes
71-
plt.tight_layout()
72-
7372
if filename:
7473
fig.savefig(filename, dpi=fig.dpi)
7574
plt.close(fig) # close the figure to free the memory

0 commit comments

Comments
 (0)