mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-18 08:53:42 +00:00
No longer use %-d for strftime since it is not supported in Windows
This commit is contained in:
parent
2c8419e673
commit
1a6b736cca
1 changed files with 4 additions and 2 deletions
|
|
@ -15,7 +15,8 @@ from datetime import timedelta
|
||||||
import pickle
|
import pickle
|
||||||
|
|
||||||
from matplotlib import pyplot as plt
|
from matplotlib import pyplot as plt
|
||||||
from matplotlib.dates import DateFormatter, MonthLocator
|
from matplotlib.dates import DateFormatter, MonthLocator, num2date
|
||||||
|
from matplotlib.ticker import FuncFormatter
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
@ -818,7 +819,8 @@ class Prophet(object):
|
||||||
df_s['yearly_upper'], color='#0072B2', alpha=0.2)]
|
df_s['yearly_upper'], color='#0072B2', alpha=0.2)]
|
||||||
ax.grid(True, which='major', c='gray', ls='-', lw=1, 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)
|
months = MonthLocator(range(1, 13), bymonthday=1, interval=2)
|
||||||
ax.xaxis.set_major_formatter(DateFormatter('%B %-d'))
|
ax.xaxis.set_major_formatter(FuncFormatter(
|
||||||
|
lambda x, pos=None: '{dt:%B} {dt.day}'.format(dt=num2date(x))))
|
||||||
ax.xaxis.set_major_locator(months)
|
ax.xaxis.set_major_locator(months)
|
||||||
ax.set_xlabel('Day of year')
|
ax.set_xlabel('Day of year')
|
||||||
ax.set_ylabel('yearly')
|
ax.set_ylabel('yearly')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue