From 4628bcd8017c3bf3558172afd3f6216a35770679 Mon Sep 17 00:00:00 2001 From: Ben Letham Date: Thu, 1 Feb 2018 15:40:38 -0800 Subject: [PATCH] Fix error in component plotting with only one component, Py --- python/fbprophet/forecaster.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/fbprophet/forecaster.py b/python/fbprophet/forecaster.py index 4c361df..96937e9 100644 --- a/python/fbprophet/forecaster.py +++ b/python/fbprophet/forecaster.py @@ -1302,6 +1302,8 @@ class Prophet(object): fig, axes = plt.subplots(npanel, 1, facecolor='w', figsize=(9, 3 * npanel)) + if npanel == 1: + axes = [axes] for ax, plot in zip(axes, components): if plot == 'trend':