We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f7e3274 commit b18ac56Copy full SHA for b18ac56
Python_9_Plot_Scatter_Line.py
@@ -0,0 +1,32 @@
1
+# -*- coding: utf-8 -*-
2
+"""
3
+Created on Fri Nov 27 08:09:11 2020
4
+
5
+@author: Tin
6
7
+# Plot Scatter & Line Chart
8
+import pandas as pd # Dataframe Library
9
+import matplotlib.pyplot as plt # Plot Chart Library
10
11
+pd.set_option('max_columns', None) # To show all columns
12
13
+import yfinance as yf
14
+yf.pdr_override()
15
16
17
+# input
18
+symbol = 'AAPL'
19
+start = '2019-12-01'
20
+end = '2020-01-01'
21
22
23
+# dataframe
24
+data = yf.download(symbol,start,end)
25
26
+plt.figure(figsize=(14,8))
27
+plt.scatter(data.index, data['Adj Close'], color='black')
28
+plt.plot(data.index, data['Adj Close'], color='r')
29
+plt.title("Stock Scatter & Line Chart")
30
+plt.xlabel("Date")
31
+plt.ylabel("Price")
32
+plt.show()
0 commit comments