Skip to content

Commit d6ec786

Browse files
committed
remove really old references to nx
1 parent 6e5950d commit d6ec786

File tree

3 files changed

+20
-24
lines changed

3 files changed

+20
-24
lines changed

lib/matplotlib/mlab.py

+10-14
Original file line numberDiff line numberDiff line change
@@ -2999,17 +2999,15 @@ def poly_below(xmin, xs, ys):
29992999
ax.fill(xv, yv)
30003000
"""
30013001
if ma.isMaskedArray(xs) or ma.isMaskedArray(ys):
3002-
nx = ma
3003-
else:
3004-
nx = np
3002+
np = ma
30053003

3006-
xs = nx.asarray(xs)
3007-
ys = nx.asarray(ys)
3004+
xs = np.asarray(xs)
3005+
ys = np.asarray(ys)
30083006
Nx = len(xs)
30093007
Ny = len(ys)
30103008
assert(Nx==Ny)
3011-
x = xmin*nx.ones(2*Nx)
3012-
y = nx.ones(2*Nx)
3009+
x = xmin*np.ones(2*Nx)
3010+
y = np.ones(2*Nx)
30133011
x[:Nx] = xs
30143012
y[:Nx] = ys
30153013
y[Nx:] = ys[::-1]
@@ -3028,19 +3026,17 @@ def poly_between(x, ylower, yupper):
30283026
:meth:`matplotlib.axes.Axes.fill`.
30293027
"""
30303028
if ma.isMaskedArray(ylower) or ma.isMaskedArray(yupper) or ma.isMaskedArray(x):
3031-
nx = ma
3032-
else:
3033-
nx = np
3029+
np = ma
30343030

30353031
Nx = len(x)
30363032
if not cbook.iterable(ylower):
3037-
ylower = ylower*nx.ones(Nx)
3033+
ylower = ylower*np.ones(Nx)
30383034

30393035
if not cbook.iterable(yupper):
3040-
yupper = yupper*nx.ones(Nx)
3036+
yupper = yupper*np.ones(Nx)
30413037

3042-
x = nx.concatenate( (x, x[::-1]) )
3043-
y = nx.concatenate( (yupper, ylower[::-1]) )
3038+
x = np.concatenate( (x, x[::-1]) )
3039+
y = np.concatenate( (yupper, ylower[::-1]) )
30443040
return x,y
30453041

30463042

lib/matplotlib/widgets.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -827,11 +827,11 @@ class MultiCursor:
827827
Example usage::
828828
829829
from matplotlib.widgets import MultiCursor
830-
from pylab import figure, show, nx
830+
from pylab import figure, show, np
831831
832-
t = nx.arange(0.0, 2.0, 0.01)
833-
s1 = nx.sin(2*nx.pi*t)
834-
s2 = nx.sin(4*nx.pi*t)
832+
t = np.arange(0.0, 2.0, 0.01)
833+
s1 = np.sin(2*np.pi*t)
834+
s2 = np.sin(4*np.pi*t)
835835
fig = figure()
836836
ax1 = fig.add_subplot(211)
837837
ax1.plot(t, s1)

unit/legend_unit.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
from __future__ import print_function
2-
from pylab import figure, show, nx
2+
from pylab import figure, show, np
33

44
Ntests = 3
5-
t = nx.arange(0.0, 1.0, 0.05)
6-
s = nx.sin(2*nx.pi*t)
5+
t = np.arange(0.0, 1.0, 0.05)
6+
s = np.sin(2*np.pi*t)
77

88
# scatter creates a RegPolyCollection
99
fig = figure()
1010
ax = fig.add_subplot(Ntests, 1, 1)
1111
N = 100
12-
x, y = 0.9*nx.mlab.rand(2,N)
13-
area = nx.pi*(10 * nx.mlab.rand(N))**2 # 0 to 10 point radiuses
12+
x, y = 0.9*np.random.rand(2,N)
13+
area = np.pi*(10 * np.random.rand(N))**2 # 0 to 10 point radiuses
1414
ax.scatter(x,y,s=area, marker='^', c='r', label='scatter')
1515
ax.legend()
1616

1717
# vlines creates a LineCollection
1818
ax = fig.add_subplot(Ntests, 1, 2)
19-
ax.vlines(t, [0], nx.sin(2*nx.pi*t), label='vlines')
19+
ax.vlines(t, [0], np.sin(2*np.pi*t), label='vlines')
2020
ax.legend()
2121

2222
# vlines creates a LineCollection

0 commit comments

Comments
 (0)