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

Skip to content

Commit 993c9df

Browse files
committed
MEP12 on stock_demo.py
1 parent 6fd8d1a commit 993c9df

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

examples/pylab_examples/stock_demo.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
#!/usr/bin/env python
1+
import matplotlib.pyplot as plt
2+
import numpy as np
23

34
from matplotlib.ticker import MultipleLocator
4-
from pylab import *
55
from data_helper import get_two_stock_data
66

77
d1, p1, d2, p2 = get_two_stock_data()
88

9-
fig, ax = subplots()
10-
lines = plot(d1, p1, 'bs', d2, p2, 'go')
11-
xlabel('Days')
12-
ylabel('Normalized price')
13-
xlim(0, 3)
9+
fig, ax = plt.subplots()
10+
lines = plt.plot(d1, p1, 'bs', d2, p2, 'go')
11+
plt.xlabel('Days')
12+
plt.ylabel('Normalized price')
13+
plt.xlim(0, 3)
1414
ax.xaxis.set_major_locator(MultipleLocator(1))
1515

16-
title('INTC vs AAPL')
17-
legend(('INTC', 'AAPL'))
16+
plt.title('INTC vs AAPL')
17+
plt.legend(('INTC', 'AAPL'))
1818

19-
show()
19+
plt.show()

0 commit comments

Comments
 (0)