- Notifications
You must be signed in to change notification settings - Fork 134
Expand file tree
/
Copy pathPython_06_Plot_Scatter_Line.py
More file actions
Latest commit
32 lines (24 loc) · 676 Bytes
/
Copy pathPython_06_Plot_Scatter_Line.py
File metadata and controls
32 lines (24 loc) · 676 Bytes
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
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 27 08:09:11 2020
@author: Tin
"""
# Plot Scatter & Line Chart
importpandasaspd# Dataframe Library
importmatplotlib.pyplotasplt# Plot Chart Library
pd.set_option('max_columns', None) # To show all columns
importyfinanceasyf
yf.pdr_override()
# input
symbol='AAPL'
start='2019-12-01'
end='2020-01-01'
# dataframe
data=yf.download(symbol,start,end)
plt.figure(figsize=(14,8))
plt.scatter(data.index, data['Adj Close'], color='black')
plt.plot(data.index, data['Adj Close'], color='r')
plt.title("Stock Scatter & Line Chart")
plt.xlabel("Date")
plt.ylabel("Price")
plt.show()