Skip to content

Commit 4f17aab

Browse files
sdatkodanpawlik
authored andcommitted
[PCP] Figure auto-width feature
For long-running jobs, this commit causes the produced plots to be wider, so the performance statistics are always properly visible for analysis.
1 parent de1c012 commit 4f17aab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

roles/pcp_metrics/files/plot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,9 @@ def plot(df: pd.DataFrame,
517517
set_xaxis(axs)
518518
set_legend(fig, axs)
519519

520-
fig.set_figwidth(FIG_WIDTH)
520+
fig.set_figwidth(max(FIG_WIDTH,
521+
2 * df['Time'].agg(['min', 'max']).diff().dropna()
522+
.iloc[0].ceil('h').components.hours))
521523
fig.set_figheight(FIG_HEIGHT)
522524
fig.savefig(output, format='pdf', **PLOT_OPTIONS)
523525

0 commit comments

Comments
 (0)