mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-05-18 21:21:22 +00:00
Allow plotting components separately
This commit is contained in:
parent
a3a35f662f
commit
2d2e48b460
1 changed files with 5 additions and 1 deletions
|
|
@ -690,6 +690,7 @@ class Prophet(object):
|
|||
|
||||
artists = []
|
||||
if not ax:
|
||||
fig = plt.figure(facecolor='w', figsize=(10, 6))
|
||||
ax = fig.add_subplot(111)
|
||||
artists += ax.plot(fcst['ds'].values, fcst['trend'], ls='-',
|
||||
c='#0072B2')
|
||||
|
|
@ -721,6 +722,7 @@ class Prophet(object):
|
|||
"""
|
||||
artists = []
|
||||
if not ax:
|
||||
fig = plt.figure(facecolor='w', figsize=(10, 6))
|
||||
ax = fig.add_subplot(111)
|
||||
holiday_comps = self.holidays['holiday'].unique()
|
||||
y_holiday = fcst[holiday_comps].sum(1)
|
||||
|
|
@ -757,6 +759,7 @@ class Prophet(object):
|
|||
"""
|
||||
artists = []
|
||||
if not ax:
|
||||
fig = plt.figure(facecolor='w', figsize=(10, 6))
|
||||
ax = fig.add_subplot(111)
|
||||
df_s = fcst.copy()
|
||||
df_s['dow'] = df_s['ds'].dt.weekday_name
|
||||
|
|
@ -794,7 +797,8 @@ class Prophet(object):
|
|||
"""
|
||||
artists = []
|
||||
if not ax:
|
||||
ax = fig.add_subplot(npanel, 1, panel_num)
|
||||
fig = plt.figure(facecolor='w', figsize=(10, 6))
|
||||
ax = fig.add_subplot(111)
|
||||
df_s = fcst.copy()
|
||||
df_s['doy'] = df_s['ds'].map(lambda x: x.strftime('2000-%m-%d'))
|
||||
df_s = df_s.groupby('doy').first().sort_index()
|
||||
|
|
|
|||
Loading…
Reference in a new issue