浏览代码

Fix error in component plotting with only one component, Py

Ben Letham 7 年之前
父节点
当前提交
4628bcd801
共有 1 个文件被更改,包括 2 次插入0 次删除
  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':