Browse Source

Fix error in component plotting with only one component, Py

Ben Letham 7 years ago
parent
commit
4628bcd801
1 changed files with 2 additions and 0 deletions
  1. 2 0
      python/fbprophet/forecaster.py

+ 2 - 0
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':