Skip to content

Commit 7d64fce

Browse files
[BUG] fix absolute errorbar (#1579)
This PR fixes an issue that occurrs when `max_prediction_length=1`: new matplotlib versions do not allow negative yerr in the errorbar, resulting in `ValueError: 'yerr' must not contain negative values`. fixes #1145
1 parent 4d54ad6 commit 7d64fce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_forecasting/models/base/_base_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ def plot_prediction(
12551255
ax.errorbar(
12561256
x_pred,
12571257
y[[-n_pred]],
1258-
yerr=quantiles - y[-n_pred],
1258+
yerr=np.absolute(quantiles - y[-n_pred]),
12591259
c=pred_color,
12601260
capsize=1.0,
12611261
)

0 commit comments

Comments
 (0)