8000 Added the "numerix" Numeric/numarray selector module enabling matplotlib · matplotlib/matplotlib@347e90d · GitHub
[go: up one dir, main page]

Skip to content

Commit 347e90d

Browse files
committed
Added the "numerix" Numeric/numarray selector module enabling matplotlib
to work with either numarray or Numeric. See matplotlib.numerix.__doc__. svn path=/trunk/matplotlib/; revision=162
1 parent 3233e7e commit 347e90d

11 files changed

+21
-16
lines changed

examples/anim.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
import matplotlib.matlab
44
import gtk
5-
import Numeric
5+
import matplotlib.numerix as numerix
66

77
fig = matplotlib.matlab.figure(1)
8-
ind = Numeric.arange(60)
8+
ind = numerix.arange(60)
99
x_tmp=[]
1010
for i in range(100):
11-
x_tmp.append(Numeric.sin((ind+i)*Numeric.pi/15.0))
11+
x_tmp.append(numerix.sin((ind+i)*numerix.pi/15.0))
1212

13-
X=Numeric.array(x_tmp)
13+
X=numerix.array(x_tmp)
1414
lines = matplotlib.matlab.plot(X[:,0],'o')
1515

1616
manager = matplotlib.matlab.get_current_fig_manager()

examples/colours.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
22
Some simple functions to generate colours.
33
"""
4-
from Numeric import asarray
4+
from matplotlib.numerix import asarray
55
from matplotlib.mlab import linspace
66
from matplotlib.colors import colorConverter
7-
from Numeric import sum
7+
from matplotlib.numerix import sum
88

99
def pastel(colour, weight=2.4):
1010
""" Convert colour into a nice pastel shade"""

examples/data_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Some functions to load a return data for the plot demos
22

3-
from Numeric import fromstring, argsort, take, array
3+
from matplotlib.numerix import fromstring, argsort, take, array
44
def get_two_stock_data():
55
"""
66
load stock time and price data for two stocks The return values

examples/dynamic_demo_wx.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
2020
Modification History:
2121
$Log$
22+
Revision 1.2 2004/02/26 20:22:58 jaytmiller
23+
Added the "numerix" Numeric/numarray selector module enabling matplotlib
24+
to work with either numarray or Numeric. See matplotlib.numerix.__doc__.
25+
2226
Revision 1.1 2003/12/30 17:22:09 jodonoghue
2327
First version of dynamic_demo for backend_wx
2428
@@ -29,7 +33,7 @@
2933

3034
from matplotlib.backends import Figure, Toolbar, FigureManager
3135
from matplotlib.axes import Subplot
32-
import Numeric as numpy
36+
import matplotlib.numerix as numpy
3337

3438
from matplotlib.matlab import *
3539
from wxPython.wx import *

examples/embedding_in_gtk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from Numeric import arange, sin, pi
1+
from matplotlib.numerix import arange, sin, pi
22

33
import matplotlib
44
matplotlib.use('GTK')

examples/embedding_in_gtk2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from Numeric import arange, sin, pi
1+
from matplotlib.numerix import arange, sin, pi
22

33
import matplotlib
44
matplotlib.use('GTK')

examples/embedding_in_wx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
from matplotlib.figure import Figure
4444
from matplotlib.axes import Subplot
45-
import Numeric as numpy
45+
import matplotlib.numerix as numpy
4646
from wxPython.wx import *
4747

4848

examples/mpl_with_glade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from matplotlib.axes import Subplot
66
from matplotlib.backends.backend_gtk import FigureCanvasGTK, NavigationToolbar
77

8-
from Numeric import arange, sin, pi
8+
from matplotlib.numerix import arange, sin, pi
99
import gtk
1010
import gtk.glade
1111

examples/object_picker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66

77
from __future__ import division
8-
from Numeric import sin, pi, arange, absolute, sqrt
8+
from matplotlib.numerix import sin, pi, arange, absolute, sqrt
99

1010
import matplotlib
1111
matplotlib.use('GTK')

examples/stock_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from matplotlib.matlab import *
33
from data_helper import get_two_stock_data
4-
import Numeric as numpy
4+
import matplotlib.numerix as numpy
55
(d1, p1, d2, p2 ) = get_two_stock_data()
66

77
plot(d1, p1, 'bs', d2, p2, 'go')

examples/vline_demo.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from matplotlib.matlab import *
2-
from RandomArray import normal
3-
from Numeric import sin, exp, multiply, absolute, pi
2+
from matplotlib.numerix import sin, exp, multiply, absolute, pi
3+
import matplotlib.numerix as numerix
4+
normal = numerix.RandomArray.normal
45

56
def f(t):
67
s1 = sin(2*pi*t)

0 commit comments

Comments
 (0)
0