Skip to content

Commit

Permalink
Fix the height_ratios of each subplot
Browse files Browse the repository at this point in the history
  • Loading branch information
cnhwl committed Jan 6, 2025
1 parent 8aea4c0 commit c6b799e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions darts/ad/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,13 @@ def show_anomalies_from_scores(
plots_per_ts = nbr_plots * series_width if multivariate_plot else nbr_plots
fig, axs = plt.subplots(
plots_per_ts,
figsize=(8, 4 + 2 * (plots_per_ts - 1)),
figsize=(8, 4 * (plots_per_ts // nbr_plots) + 2 * (nbr_plots - 1)),
sharex=True,
gridspec_kw={"height_ratios": [2] + [1] * (plots_per_ts - 1)},
gridspec_kw={
"height_ratios": ([2] + [1] * (nbr_plots - 1)) * (plots_per_ts // nbr_plots)
},
squeeze=False,
constrained_layout=True,
layout="constrained",
)

for i in range(series_width if multivariate_plot else 1):
Expand Down

0 comments on commit c6b799e

Please sign in to comment.