8000 Merge pull request #4652 from ericmjl/mep12-stock_demo.py · matplotlib/matplotlib@c4abea9 · GitHub
[go: up one dir, main page]

Skip to content

Commit c4abea9

Browse files
committed
Merge pull request #4652 from ericmjl/mep12-stock_demo.py
Mep12 stock demo.py
2 parents e23e404 + 993c9df commit c4abea9

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)
0