Skip to content

Commit

Permalink
update 3D plot margins
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Aug 6, 2023
1 parent 9465be1 commit d9b1956
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/microstructpy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,12 +735,13 @@ def plot_seeds(seeds, phases, domain, plot_files=[], plot_axes=True,
_misc.axisEqual3D(plt.gca())

# Save plot
plt.tight_layout()
for fname in plot_files:
if n_dim == 3:
fig.subplots_adjust(**_misc.plt_3d_adj)
plt.savefig(fname, pad_inches=0.15)
_misc.axisEqual3D(ax)
plt.subplots_adjust(left=0, bottom=.05, right=1, top=1, wspace=0, hspace=0)
plt.savefig(fname)
else:
plt.tight_layout()
plt.savefig(fname, pad_inches=0)

plt.close('all')
Expand Down Expand Up @@ -861,12 +862,13 @@ def plot_poly(pmesh, phases, plot_files=['polymesh.png'], plot_axes=True,
pmesh.plot(facecolors=fcs, index_by='seed', **edge_kwargs)

# save plot
plt.tight_layout()
for fname in plot_files:
if n_dim == 3:
fig.subplots_adjust(**_misc.plt_3d_adj)
plt.savefig(fname, pad_inches=0.15)
_misc.axisEqual3D(ax)
plt.subplots_adjust(left=0, bottom=.05, right=1, top=1, wspace=0, hspace=0)
plt.savefig(fname)
else:
plt.tight_layout()
plt.savefig(fname, pad_inches=0)
plt.close('all')

Expand Down Expand Up @@ -1038,12 +1040,13 @@ def plot_tri(tmesh, phases, seeds, pmesh, plot_files=[], plot_axes=True,
tmesh.plot(facecolors=fcs, index_by='attribute', **edge_kwargs)

# save plot
plt.tight_layout()
for fname in plot_files:
if n_dim == 3:
fig.subplots_adjust(**_misc.plt_3d_adj)
plt.savefig(fname, pad_inches=0.15)
_misc.axisEqual3D(ax)
plt.subplots_adjust(left=0, bottom=.05, right=1, top=1, wspace=0, hspace=0)
plt.savefig(fname)
else:
plt.tight_layout()
plt.savefig(fname, pad_inches=0)

plt.close('all')
Expand Down

0 comments on commit d9b1956

Please sign in to comment.