Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 37f7df6

Browse filesBrowse files
committed
Merge pull request #4932 from ericmjl/mep12-load_converter.py
MEP12 on load_converter.py
2 parents 1e1173b + 5c8efc9 commit 37f7df6
Copy full SHA for 37f7df6

File tree

Expand file treeCollapse file tree

1 file changed

+8
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-9
lines changed
+8-9Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
from __future__ import print_function
2-
from matplotlib.dates import bytespdate2num
3-
#from matplotlib.mlab import load
42
import numpy as np
5-
from pylab import figure, show
3+
import matplotlib.pyplot as plt
64
import matplotlib.cbook as cbook
5+
import matplotlib.dates as mdates
6+
from matplotlib.dates import bytespdate2num
77

88
datafile = cbook.get_sample_data('msft.csv', asfileobj=False)
99
print('loading', datafile)
1010

11-
dates, closes = np.loadtxt(
12-
datafile, delimiter=',',
13-
converters={0: bytespdate2num('%d-%b-%y')},
14-
skiprows=1, usecols=(0, 2), unpack=True)
11+
dates, closes = np.loadtxt(datafile, delimiter=',',
12+
converters={0: bytespdate2num('%d-%b-%y')},
13+
skiprows=1, usecols=(0, 2), unpack=True)
1514

16-
fig = figure()
15+
fig = plt.figure()
1716
ax = fig.add_subplot(111)
1817
ax.plot_date(dates, closes, '-')
1918
fig.autofmt_xdate()
20-
show()
19+
plt.show()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.