Skip to content

Commit

Permalink
auto figure scaling for multiple plots
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-ashe committed Sep 26, 2023
1 parent f68f71b commit c5194b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions process/io/plot_scans.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,9 @@ def main(args=None):
# Plot section
# -----------
if stack_plots:
fig, axs = plt.subplots(len(output_names), 1, figsize=(8.0, 12.8))
fig, axs = plt.subplots(
len(output_names), 1, figsize=(8.0, (3.8 + (1 * len(output_names))))
)
fig.subplots_adjust(hspace=0.0)
# fig.tight_layout()
for output_name in output_names:
Expand Down Expand Up @@ -696,7 +698,7 @@ def main(args=None):
plt.tight_layout()
# axs[output_names.index(output_name)].get_ylim()[0])
axs[output_names.index(output_name)].set_ylim(
axs[output_names.index(output_name)].get_ylim()[0] * 0.6,
axs[output_names.index(output_name)].get_ylim()[0] * 0.8,
axs[output_names.index(output_name)].get_ylim()[1] * 1.2,
)
else:
Expand Down

0 comments on commit c5194b3

Please sign in to comment.