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

Skip to content

Commit 2e75ae3

Browse files
committed
fix example to run with current MPL and numpy
svn path=/trunk/matplotlib/; revision=5549
1 parent e8f41a1 commit 2e75ae3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

examples/units/date_converter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import date_support # set up the date converters
22
import datetime
33
from matplotlib.dates import drange
4-
from pylab import figure, show, nx
4+
from pylab import figure, show
5+
import numpy as np
56

67

78
xmin = datetime.date(2007,1,1)
@@ -12,7 +13,7 @@
1213
fig = figure()
1314
fig.subplots_adjust(bottom=0.2)
1415
ax = fig.add_subplot(111)
15-
ax.plot(xdates, nx.mlab.rand(len(xdates)), 'o')
16+
ax.plot(xdates, np.random.rand(len(xdates)), 'o')
1617
ax.set_xlim(datetime.date(2007,2,1), datetime.date(2007,3,1))
1718

1819
fig.autofmt_xdate()

0 commit comments

Comments
 (0)