Revision: 7437
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7437&view=rev
Author:   leejjoon
Date:     2009-08-09 04:50:12 +0000 (Sun, 09 Aug 2009)

Log Message:
-----------
retrieve a sample image using cbook.get_sample_data function

Modified Paths:
--------------
    trunk/matplotlib/examples/axes_grid/demo_axes_divider.py
    trunk/matplotlib/examples/axes_grid/demo_axes_grid.py
    trunk/matplotlib/examples/axes_grid/inset_locator_demo2.py
    trunk/matplotlib/examples/axes_grid/simple_axesgrid2.py
    trunk/matplotlib/examples/axes_grid/simple_rgb.py

Removed Paths:
-------------
    trunk/matplotlib/lib/mpl_toolkits/axes_grid/demo_image.py

Modified: trunk/matplotlib/examples/axes_grid/demo_axes_divider.py
===================================================================
--- trunk/matplotlib/examples/axes_grid/demo_axes_divider.py    2009-08-09 
04:34:08 UTC (rev 7436)
+++ trunk/matplotlib/examples/axes_grid/demo_axes_divider.py    2009-08-09 
04:50:12 UTC (rev 7437)
@@ -1,7 +1,14 @@
 import matplotlib.pyplot as plt
-from mpl_toolkits.axes_grid.demo_image import get_demo_image
-#import mpl_toolkits.imaging.axes_grid as imaging
 
+def get_demo_image():
+    import numpy as np
+    from matplotlib.cbook import get_sample_data
+    f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False)
+    z = np.load(f)
+    # z is a numpy array of 15x15
+    return z, (-3,4,-4,3)
+
+
 def demo_simple_image(ax):
     Z, extent = get_demo_image()
 

Modified: trunk/matplotlib/examples/axes_grid/demo_axes_grid.py
===================================================================
--- trunk/matplotlib/examples/axes_grid/demo_axes_grid.py       2009-08-09 
04:34:08 UTC (rev 7436)
+++ trunk/matplotlib/examples/axes_grid/demo_axes_grid.py       2009-08-09 
04:50:12 UTC (rev 7437)
@@ -1,7 +1,13 @@
 import matplotlib.pyplot as plt
-from mpl_toolkits.axes_grid.demo_image import get_demo_image
 from mpl_toolkits.axes_grid import AxesGrid
 
+def get_demo_image():
+    import numpy as np
+    from matplotlib.cbook import get_sample_data
+    f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False)
+    z = np.load(f)
+    # z is a numpy array of 15x15
+    return z, (-3,4,-4,3)
 
 def demo_simple_grid(fig):
     """

Modified: trunk/matplotlib/examples/axes_grid/inset_locator_demo2.py
===================================================================
--- trunk/matplotlib/examples/axes_grid/inset_locator_demo2.py  2009-08-09 
04:34:08 UTC (rev 7436)
+++ trunk/matplotlib/examples/axes_grid/inset_locator_demo2.py  2009-08-09 
04:50:12 UTC (rev 7437)
@@ -5,7 +5,13 @@
 
 import numpy as np
 
-from mpl_toolkits.axes_grid.demo_image import get_demo_image
+def get_demo_image():
+    from matplotlib.cbook import get_sample_data
+    import numpy as np
+    f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False)
+    z = np.load(f)
+    # z is a numpy array of 15x15
+    return z, (-3,4,-4,3)
 
 
 fig = plt.figure(1, [5,4])

Modified: trunk/matplotlib/examples/axes_grid/simple_axesgrid2.py
===================================================================
--- trunk/matplotlib/examples/axes_grid/simple_axesgrid2.py     2009-08-09 
04:34:08 UTC (rev 7436)
+++ trunk/matplotlib/examples/axes_grid/simple_axesgrid2.py     2009-08-09 
04:50:12 UTC (rev 7437)
@@ -1,7 +1,14 @@
 import matplotlib.pyplot as plt
 from mpl_toolkits.axes_grid import AxesGrid
-from mpl_toolkits.axes_grid.demo_image import get_demo_image
 
+def get_demo_image():
+    import numpy as np
+    from matplotlib.cbook import get_sample_data
+    f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False)
+    z = np.load(f)
+    # z is a numpy array of 15x15
+    return z, (-3,4,-4,3)
+
 F = plt.figure(1, (5.5, 3.5))
 grid = AxesGrid(F, 111, # similar to subplot(111)
                 nrows_ncols = (1, 3),

Modified: trunk/matplotlib/examples/axes_grid/simple_rgb.py
===================================================================
--- trunk/matplotlib/examples/axes_grid/simple_rgb.py   2009-08-09 04:34:08 UTC 
(rev 7436)
+++ trunk/matplotlib/examples/axes_grid/simple_rgb.py   2009-08-09 04:50:12 UTC 
(rev 7437)
@@ -1,8 +1,15 @@
 import matplotlib.pyplot as plt
 
-from mpl_toolkits.axes_grid.demo_image import get_demo_image
 from mpl_toolkits.axes_grid.axes_rgb import RGBAxes
 
+def get_demo_image():
+    import numpy as np
+    from matplotlib.cbook import get_sample_data
+    f = get_sample_data("axes_grid/bivariate_normal.npy", asfileobj=False)
+    z = np.load(f)
+    # z is a numpy array of 15x15
+    return z, (-3,4,-4,3)
+
 def get_rgb():
     Z, extent = get_demo_image()
 

Deleted: trunk/matplotlib/lib/mpl_toolkits/axes_grid/demo_image.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/demo_image.py   2009-08-09 
04:34:08 UTC (rev 7436)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/demo_image.py   2009-08-09 
04:50:12 UTC (rev 7437)
@@ -1,17 +0,0 @@
-import numpy as np
-
-def get_demo_image():
-    # prepare image
-    delta = 0.5
-
-    extent = (-3,4,-4,3)
-    x = np.arange(-3.0, 4.001, delta)
-    y = np.arange(-4.0, 3.001, delta)
-    X, Y = np.meshgrid(x, y)
-    import matplotlib.mlab as mlab
-    Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
-    Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
-    Z = (Z1 - Z2) * 10
-
-    return Z, extent
-


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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to