From 597fce143fcc752956e2d73135c1307bda5faf3f Mon Sep 17 00:00:00 2001 From: Isaac Laughlin Date: Fri, 3 Mar 2017 14:21:10 -0800 Subject: [PATCH] Adding docstrings to new plotting methods. --- python/fbprophet/forecaster.py | 54 +++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/python/fbprophet/forecaster.py b/python/fbprophet/forecaster.py index 1067880..d4b96f3 100644 --- a/python/fbprophet/forecaster.py +++ b/python/fbprophet/forecaster.py @@ -664,7 +664,20 @@ class Prophet(object): fig.tight_layout() return artists - def plot_trend(self, fcst, ax=None, uncertainty=True, **plotargs): + def plot_trend(self, fcst, ax=None, uncertainty=True): + """Plot the trend component of the forecast. + + Parameters + ---------- + fcst: pd.DataFrame output of self.predict. + ax: Optional matplotlib Axes to plot on. + uncertainty: Optional boolean to plot uncertainty intervals. + + Returns + ------- + a list of matplotlib artists + """ + artists = [] if not ax: ax = fig.add_subplot(111) @@ -683,6 +696,19 @@ class Prophet(object): return artists def plot_holidays(self, fcst, ax=None, uncertainty=True): + """Plot the holidays component of the forecast. + + Parameters + ---------- + fcst: pd.DataFrame output of self.predict. + ax: Optional matplotlib Axes to plot on. One will be created if this + is not provided. + uncertainty: Optional boolean to plot uncertainty intervals. + + Returns + ------- + a list of matplotlib artists + """ artists = [] if not ax: ax = fig.add_subplot(111) @@ -706,6 +732,19 @@ class Prophet(object): return artists def plot_weekly(self, fcst, ax=None, uncertainty=True): + """Plot the weekly component of the forecast. + + Parameters + ---------- + fcst: pd.DataFrame output of self.predict. + ax: Optional matplotlib Axes to plot on. One will be created if this + is not provided. + uncertainty: Optional boolean to plot uncertainty intervals. + + Returns + ------- + a list of matplotlib artists + """ artists = [] if not ax: ax = fig.add_subplot(111) @@ -730,6 +769,19 @@ class Prophet(object): return artists def plot_yearly(self, fcst, ax=None, uncertainty=True): + """Plot the yearly component of the forecast. + + Parameters + ---------- + fcst: pd.DataFrame output of self.predict. + ax: Optional matplotlib Axes to plot on. One will be created if + this is not provided. + uncertainty: Optional boolean to plot uncertainty intervals. + + Returns + ------- + a list of matplotlib artists + """ artists = [] if not ax: ax = fig.add_subplot(npanel, 1, panel_num)