Skip to content

Commit 78a9669

Browse files
Add files via upload
1 parent d9c64ca commit 78a9669

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Python_7_Plot_Histogram.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Fri Nov 27 08:09:11 2020
4+
5+
@author: Tin
6+
"""
7+
# Plot Histogram
8+
import matplotlib.pyplot as plt
9+
import yfinance as yf
10+
yf.pdr_override()
11+
12+
13+
# input
14+
symbol = 'AAPL'
15+
start = '2019-01-01'
16+
end = '2020-01-01'
17+
18+
19+
# dataframe
20+
data = yf.download(symbol,start,end)
21+
22+
plt.figure(figsize=(14,10))
23+
plt.bar(data.index, data['Adj Close'])
24+
plt.title("Stock Histogram Chart")
25+
plt.xlabel("Date")
26+
plt.ylabel("Price")
27+
plt.show()
28+

0 commit comments

Comments
 (0)