Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c4819c2

Browse files
committed
cleaned up usage of quotes_historical_yahoo in demos
1 parent e772ac4 commit c4819c2

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

examples/pylab_examples/date_demo1.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
"""
1616

1717
import matplotlib.pyplot as plt
18-
from matplotlib.finance import quotes_historical_yahoo
18+
from matplotlib.finance import quotes_historical_yahoo_ochl
1919
from matplotlib.dates import YearLocator, MonthLocator, DateFormatter
2020
import datetime
21-
date1 = datetime.date( 1995, 1, 1 )
22-
date2 = datetime.date( 2004, 4, 12 )
21+
date1 = datetime.date(1995, 1, 1)
22+
date2 = datetime.date(2004, 4, 12)
2323

24-
years = YearLocator() # every year
25-
months = MonthLocator() # every month
24+
years = YearLocator() # every year
25+
months = MonthLocator() # every month
2626
yearsFmt = DateFormatter('%Y')
2727

28-
quotes = quotes_historical_yahoo(
28+
quotes = quotes_historical_yahoo_ochl(
2929
'INTC', date1, date2)
3030
if len(quotes) == 0:
3131
raise SystemExit

examples/pylab_examples/date_demo2.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
import datetime
1010
import matplotlib.pyplot as plt
1111
from matplotlib.dates import MONDAY
12-
from matplotlib.finance import quotes_historical_yahoo
12+
from matplotlib.finance import quotes_historical_yahoo_ochl
1313
from matplotlib.dates import MonthLocator, WeekdayLocator, DateFormatter
1414

1515

16-
date1 = datetime.date( 2002, 1, 5 )
17-
date2 = datetime.date( 2003, 12, 1 )
16+
date1 = datetime.date(2002, 1, 5)
17+
date2 = datetime.date(2003, 12, 1)
1818

1919
# every monday
20-
mondays = WeekdayLocator(MONDAY)
20+
mondays = WeekdayLocator(MONDAY)
2121

2222
# every 3rd month
23-
months = MonthLocator(range(1,13), bymonthday=1, interval=3)
23+
months = MonthLocator(range(1, 13), bymonthday=1, interval=3)
2424
monthsFmt = DateFormatter("%b '%y")
2525

2626

27-
quotes = quotes_historical_yahoo('INTC', date1, date2)
27+
quotes = quotes_historical_yahoo_ochl('INTC', date1, date2)
2828
if len(quotes) == 0:
2929
print ('Found no quotes')
3030
raise SystemExit

0 commit comments

Comments
 (0)