-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathvisual.py
32 lines (27 loc) · 1.04 KB
/
visual.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
32
import math
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
def plot(predicted=None, real=None):
if predicted != None and real != None:
plt.plot(real[:], color = 'red', label = 'Real Stock Price')
plt.plot(predicted[:], color = 'blue', label = 'Predicted Stock Price')
plt.title('Stock Price Prediction')
plt.xlabel('Index')
plt.ylabel('Stock Price')
plt.savefig('stock_price_predicted_real.png')
plt.show()
elif predicted != None:
plt.plot(predicted[:], color = 'blue', label = 'Predicted Stock Price')
plt.title('Predicted Stock Prices')
plt.xlabel('Index')
plt.ylabel('Stock Price')
plt.savefig('Predicted_stock_price.png')
plt.show()
elif real != None:
plt.plot(real[:], color = 'red', label = 'Real Stock Price')
plt.title('Real Stock Prices')
plt.xlabel('Index')
plt.ylabel('Stock Price')
plt.savefig('Real_stock_price.png')
plt.show()