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

Skip to content

Commit 74f16b6

Browse files
committed
DOC: remove pylab from units example
1 parent 047b2cc commit 74f16b6

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

examples/units/units_scatter.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,24 @@
1010
"""
1111
import numpy as np
1212
from basic_units import secs, hertz, minutes
13-
from matplotlib.pylab import figure, show
13+
from matplotlib import pyplot
1414

1515
# create masked array
1616

1717

1818
xsecs = secs*np.ma.MaskedArray((1, 2, 3, 4, 5, 6, 7, 8), (1, 0, 1, 0, 0, 0, 1, 0), float)
1919
#xsecs = secs*np.arange(1,10.)
2020

21-
fig = figure()
21+
fig, (ax1, ax2, ax3) = pyplot.figure(nrows=3, sharex=True)
2222
ax1 = fig.add_subplot(3, 1, 1)
2323
ax1.scatter(xsecs, xsecs)
24-
#ax1.set_ylabel('seconds')
2524
ax1.axis([0, 10, 0, 10])
2625

27-
ax2 = fig.add_subplot(3, 1, 2, sharex=ax1)
2826
ax2.scatter(xsecs, xsecs, yunits=hertz)
2927
ax2.axis([0, 10, 0, 1])
3028

31-
ax3 = fig.add_subplot(3, 1, 3, sharex=ax1)
3229
ax3.scatter(xsecs, xsecs, yunits=hertz)
3330
ax3.yaxis.set_units(minutes)
3431
ax3.axis([0, 10, 0, 1])
3532

36-
show()
33+
fig.show()

0 commit comments

Comments
 (0)