update seaborn style

This commit is contained in:
Simon 2024-01-06 09:08:42 +07:00
parent 0641b8bf20
commit cebb5a3bcd
Signed by: simon
GPG Key ID: 2C15AA5E89985DD4
3 changed files with 7 additions and 7 deletions

View File

@ -89,7 +89,7 @@ class CurrentPlot:
# calc ticks # calc ticks
y_max = np.ceil(y.max()/50)*50 + 50 y_max = np.ceil(y.max()/50)*50 + 50
# setup plot # setup plot
plt.style.use('seaborn') plt.style.use('seaborn-v0_8')
plt.plot(x, y, color='#313131',) plt.plot(x, y, color='#313131',)
# fill colors # fill colors
plt_fill(plt, x, y) plt_fill(plt, x, y)

View File

@ -183,7 +183,7 @@ class MonthGenerator():
x_dates = [f'{str(i).zfill(2)} {month_short}' for i in x_numbers] x_dates = [f'{str(i).zfill(2)} {month_short}' for i in x_numbers]
x_ticks = x_range, x_dates x_ticks = x_range, x_dates
# plot # plot
plt.style.use('seaborn') plt.style.use('seaborn-v0_8')
plt.plot(x, y_1, color='#313131', label='this year') plt.plot(x, y_1, color='#313131', label='this year')
plt.plot( plt.plot(
x, y_2, color='#666666', linestyle='dashed', label='last year' x, y_2, color='#666666', linestyle='dashed', label='last year'

View File

@ -192,7 +192,7 @@ class LastSevenDays:
x_ticks = self.axis['x_ticks'] x_ticks = self.axis['x_ticks']
y_max = np.ceil(max(pd.concat([y_1, y_2]))/50)*50 + 50 y_max = np.ceil(max(pd.concat([y_1, y_2]))/50)*50 + 50
# plot # plot
plt.style.use('seaborn') plt.style.use('seaborn-v0_8')
plt.plot(x, y_1, color='#313131', label='2hour avg') plt.plot(x, y_1, color='#313131', label='2hour avg')
plt.plot(x, y_2, color='#cc0000', label='daily avg') plt.plot(x, y_2, color='#cc0000', label='daily avg')
# fill colors # fill colors
@ -284,7 +284,7 @@ class LastThreeDays:
x = axis['x'] x = axis['x']
y = axis['y'].replace(0, 1) y = axis['y'].replace(0, 1)
x_ticks = np.arange(0, 97, step=8) x_ticks = np.arange(0, 97, step=8)
plt.style.use('seaborn') plt.style.use('seaborn-v0_8')
plt.plot(x, y, color='#313131',) plt.plot(x, y, color='#313131',)
# fill colors # fill colors
plt_fill(plt, x, y) plt_fill(plt, x, y)
@ -363,7 +363,7 @@ class PmGraphs:
else: else:
col.append('#ff4d4d') col.append('#ff4d4d')
# plot # plot
plt.style.use('seaborn') plt.style.use('seaborn-v0_8')
plt.bar(x_dates, y, color=col, width=0.5) plt.bar(x_dates, y, color=col, width=0.5)
plt.axhline(y=thresh, color='#6ecd65', linestyle=':') plt.axhline(y=thresh, color='#6ecd65', linestyle=':')
plt.xticks(ticks=x_range, labels=x_dates) plt.xticks(ticks=x_range, labels=x_dates)
@ -426,7 +426,7 @@ class HourBar:
# color columns # color columns
col = NightlyPlots.color_colums(y) col = NightlyPlots.color_colums(y)
# create plot # create plot
plt.style.use('seaborn') plt.style.use('seaborn-v0_8')
plt.bar(x, y, color=col, width=0.5) plt.bar(x, y, color=col, width=0.5)
plt.yticks(np.arange(0, y_max, step=50)) plt.yticks(np.arange(0, y_max, step=50))
plt.xticks(ticks=x_range, labels=x_hours) plt.xticks(ticks=x_range, labels=x_hours)
@ -549,7 +549,7 @@ class YearComparison:
# build plot # build plot
plt.title("Daily avg AQI values compared to last year", fontsize=15) plt.title("Daily avg AQI values compared to last year", fontsize=15)
chart_fill(plt, y_ticks) chart_fill(plt, y_ticks)
plt.style.use("seaborn") plt.style.use("seaborn-v0_8")
plt.plot(x, y_1, color="#313131", label="this year") plt.plot(x, y_1, color="#313131", label="this year")
plt.plot( plt.plot(
x, y_2, color="#666666", linestyle="dashed", label="last year" x, y_2, color="#666666", linestyle="dashed", label="last year"