replacing 0 with on for graphs to coninue the line

This commit is contained in:
simon 2021-09-09 10:26:08 +07:00
parent f4dd0d08aa
commit f8eec5c74f
3 changed files with 6 additions and 6 deletions

View File

@ -81,7 +81,7 @@ class CurrentPlot:
def write_plt(self):
""" save plot to file """
x = self.axis['x']
y = self.axis['y']
y = self.axis['y'].replace(0, 1)
x_ticks = self.axis['x_ticks']
# calc ticks
y_max = np.ceil(y.max()/50)*50 + 50

View File

@ -153,8 +153,8 @@ class MonthGenerator():
def write_plt(self):
""" write monthly plot """
x = self.axis['x']
y_1 = self.axis['y_1']
y_2 = self.axis['y_2']
y_1 = self.axis['y_1'].replace(0, 1)
y_2 = self.axis['y_2'].replace(0, 1)
# parse timestamp
date_month = datetime.fromtimestamp(self.m_rows[-1][0]).date()
date_title = date_month.strftime('%b %Y')

View File

@ -151,8 +151,8 @@ class LastSevenDays:
def write_plt(self):
""" write last 7 days plot to disk """
x = self.axis['x']
y_1 = self.axis['y_1']
y_2 = self.axis['y_2']
y_1 = self.axis['y_1'].replace(0, 1)
y_2 = self.axis['y_2'].replace(0, 1)
x_ticks = self.axis['x_ticks']
y_max = np.ceil(max(y_1.append(y_2))/50)*50 + 50
# plot
@ -229,7 +229,7 @@ class LastThreeDays:
def write_plt(self, axis, day):
""" write daily plot to disk """
x = axis['x']
y = axis['y']
y = axis['y'].replace(0, 1)
x_ticks = np.arange(0, 97, step=8)
plt.style.use('seaborn')
plt.plot(x, y, color='#313131',)