forked from Akash-Tandale001/Power_Theft_Detection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Visualisation2d.py
31 lines (26 loc) · 1.07 KB
/
Visualisation2d.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 2D data plot
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
def visualisation2D():
rawData1 = pd.read_csv('./visualization.csv', nrows=3)
cols = rawData1.columns
rawData2 = pd.read_csv('./visualization.csv', skiprows=187)
rawData2.columns = cols
data = pd.concat([rawData1, rawData2], ignore_index=True)
fig4, axs4 = plt.subplots(2, 1)
fig4.suptitle('Four Week Consumption', fontsize=16)
plt.subplots_adjust(hspace=0.5)
for i in range(59, 83, 7):
axs4[0].plot(data.iloc[1, i:i + 7].to_numpy(), marker='>', linestyle='-',label='$week {i}$'.format(i=(i % 58) % 6))
axs4[0].legend(loc='best')
axs4[0].set_title('With Fraud', fontsize=14)
axs4[0].set_ylabel('Consumption')
axs4[0].grid(True)
for i in range(59, 83, 7):
axs4[1].plot(data.iloc[6, i:i + 7].to_numpy(), marker='>', linestyle='-',label='$week {i}$'.format(i=(i % 58) % 6))
axs4[1].legend(loc='best')
axs4[1].set_title('Without fraud', fontsize=14)
axs4[1].set_ylabel('Consumption')
axs4[1].grid(True)
plt.show()