mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-05-14 20:48:08 +00:00
Merge pull request #2598 from YuyuZhou1228/main
Removed remaining depreciated datetime conversions (#2492)
This commit is contained in:
commit
83e124dfa5
1 changed files with 5 additions and 5 deletions
|
|
@ -225,7 +225,7 @@ def plot_forecast_component(
|
|||
if not ax:
|
||||
fig = plt.figure(facecolor='w', figsize=figsize)
|
||||
ax = fig.add_subplot(111)
|
||||
fcst_t = fcst['ds'].dt.to_pydatetime()
|
||||
fcst_t = fcst['ds']
|
||||
artists += ax.plot(fcst_t, fcst[name], ls='-', c='#0072B2')
|
||||
if 'cap' in fcst and plot_cap:
|
||||
artists += ax.plot(fcst_t, fcst['cap'], ls='--', c='k')
|
||||
|
|
@ -348,10 +348,10 @@ def plot_yearly(m, ax=None, uncertainty=True, yearly_start=0, figsize=(10, 6), n
|
|||
df_y = seasonality_plot_df(m, days)
|
||||
seas = m.predict_seasonal_components(df_y)
|
||||
artists += ax.plot(
|
||||
df_y['ds'].dt.to_pydatetime(), seas[name], ls='-', c='#0072B2')
|
||||
df_y['ds'], seas[name], ls='-', c='#0072B2')
|
||||
if uncertainty and m.uncertainty_samples:
|
||||
artists += [ax.fill_between(
|
||||
df_y['ds'].dt.to_pydatetime(), seas[name + '_lower'],
|
||||
df_y['ds'], seas[name + '_lower'],
|
||||
seas[name + '_upper'], color='#0072B2', alpha=0.2)]
|
||||
ax.grid(True, which='major', c='gray', ls='-', lw=1, alpha=0.2)
|
||||
months = MonthLocator(range(1, 13), bymonthday=1, interval=2)
|
||||
|
|
@ -394,11 +394,11 @@ def plot_seasonality(m, name, ax=None, uncertainty=True, figsize=(10, 6)):
|
|||
days = pd.to_datetime(np.linspace(start.value, end.value, plot_points))
|
||||
df_y = seasonality_plot_df(m, days)
|
||||
seas = m.predict_seasonal_components(df_y)
|
||||
artists += ax.plot(df_y['ds'].dt.to_pydatetime(), seas[name], ls='-',
|
||||
artists += ax.plot(df_y['ds'], seas[name], ls='-',
|
||||
c='#0072B2')
|
||||
if uncertainty and m.uncertainty_samples:
|
||||
artists += [ax.fill_between(
|
||||
df_y['ds'].dt.to_pydatetime(), seas[name + '_lower'],
|
||||
df_y['ds'], seas[name + '_lower'],
|
||||
seas[name + '_upper'], color='#0072B2', alpha=0.2)]
|
||||
ax.grid(True, which='major', c='gray', ls='-', lw=1, alpha=0.2)
|
||||
n_ticks = 8
|
||||
|
|
|
|||
Loading…
Reference in a new issue