Revision: 3700
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3700&view=rev
Author:   efiring
Date:     2007-08-11 23:08:36 -0700 (Sat, 11 Aug 2007)

Log Message:
-----------
Minor numpifications

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/axes.py
    trunk/matplotlib/lib/matplotlib/axes3d.py
    trunk/matplotlib/lib/matplotlib/collections.py

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py     2007-08-10 18:49:41 UTC (rev 
3699)
+++ trunk/matplotlib/lib/matplotlib/axes.py     2007-08-12 06:08:36 UTC (rev 
3700)
@@ -4364,7 +4364,7 @@
         if len(args)==1:
             C = args[0]
             numRows, numCols = C.shape
-            X, Y = mlab.meshgrid(npy.arange(numCols+1), npy.arange(numRows+1) )
+            X, Y = npy.meshgrid(npy.arange(numCols+1), npy.arange(numRows+1) )
         elif len(args)==3:
             X, Y, C = args
             numRows, numCols = C.shape
@@ -4517,7 +4517,7 @@
         if len(args)==1:
             C = args[0]
             numRows, numCols = C.shape
-            X, Y = mlab.meshgrid(npy.arange(numCols+1), npy.arange(numRows+1) )
+            X, Y = npy.meshgrid(npy.arange(numCols+1), npy.arange(numRows+1) )
         elif len(args)==3:
             X, Y, C = args
             numRows, numCols = C.shape
@@ -4630,9 +4630,8 @@
         you can verify that with
 
           # trapezoidal integration of the probability density function
-          from matplotlib.mlab import trapz
           pdf, bins, patches = ax.hist(...)
-          print trapz(bins, pdf)
+          print npy.trapz(pdf, bins)
 
         align = 'edge' | 'center'.  Interprets bins either as edge
         or center values
@@ -4650,7 +4649,7 @@
         %(Rectangle)s
         """
         if not self._hold: self.cla()
-        n, bins = mlab.hist(x, bins, normed)
+        n, bins = npy.histogram(x, bins, range=None, normed=normed)
         if width is None: width = 0.9*(bins[1]-bins[0])
         if orientation == 'horizontal':
             patches = self.barh(bins, n, height=width, left=bottom,
@@ -5266,7 +5265,7 @@
         self._set_artist_props(self.title)
 
 
-        self.thetas = mlab.linspace(0, 2*math.pi, self.RESOLUTION)
+        self.thetas = npy.linspace(0, 2*math.pi, self.RESOLUTION)
 
         verts = zip(self.thetas, npy.ones(self.RESOLUTION))
         self.axesPatch = mpatches.Polygon(
@@ -5352,7 +5351,7 @@
         for t in self.thetagridlabels:
             t.set_y(1.05*rmax)
 
-        r = mlab.linspace(0, rmax, self.RESOLUTION)
+        r = npy.linspace(0, rmax, self.RESOLUTION)
         for l in self.thetagridlines:
             l.set_ydata(r)
 
@@ -5396,7 +5395,7 @@
         rpad = rpad * max(radii)
         cbook.popall(self.rgridlines)
 
-        theta = mlab.linspace(0., 2*math.pi, self.RESOLUTION)
+        theta = npy.linspace(0., 2*math.pi, self.RESOLUTION)
         ls = rcParams['grid.linestyle']
         color = rcParams['grid.color']
         lw = rcParams['grid.linewidth']
@@ -5462,7 +5461,7 @@
         lw = rcParams['grid.linewidth']
 
         rmax = self.get_rmax()
-        r = mlab.linspace(0., rmax, self.RESOLUTION)
+        r = npy.linspace(0., rmax, self.RESOLUTION)
         for a in angles:
             theta = npy.ones(self.RESOLUTION)*a/180.*math.pi
             line = mlines.Line2D(

Modified: trunk/matplotlib/lib/matplotlib/axes3d.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes3d.py   2007-08-10 18:49:41 UTC (rev 
3699)
+++ trunk/matplotlib/lib/matplotlib/axes3d.py   2007-08-12 06:08:36 UTC (rev 
3700)
@@ -718,9 +718,9 @@
     ax.set_zlabel('------------ Z Label --------------------')
 
 def get_test_data(delta=0.05):
-    from mlab import meshgrid, bivariate_normal
+    from mlab import  bivariate_normal
     x = y = npy.arange(-3.0, 3.0, delta)
-    X, Y = meshgrid(x,y)
+    X, Y = npy.meshgrid(x,y)
 
     Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
     Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)

Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py      2007-08-10 18:49:41 UTC 
(rev 3699)
+++ trunk/matplotlib/lib/matplotlib/collections.py      2007-08-12 06:08:36 UTC 
(rev 3700)
@@ -437,8 +437,8 @@
 
         Example: see examples/dynamic_collection.py for complete example
 
-        offsets = nx.mlab.rand(20,2)
-        facecolors = [cm.jet(x) for x in nx.mlab.rand(20)]
+        offsets = npy.random.rand(20,2)
+        facecolors = [cm.jet(x) for x in npy.random.rand(20)]
         black = (0,0,0,1)
 
         collection = RegularPolyCollection(


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to