Revision: 5008
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5008&view=rev
Author: efiring
Date: 2008-03-19 20:30:58 -0700 (Wed, 19 Mar 2008)
Log Message:
-----------
Updated the importation of numpy.ma; numerix.npyma is obsolete.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/CODING_GUIDE
trunk/matplotlib/examples/color_by_yvalue.py
trunk/matplotlib/examples/contourf_demo.py
trunk/matplotlib/examples/dynamic_collection.py
trunk/matplotlib/examples/image_masked.py
trunk/matplotlib/examples/masked_demo.py
trunk/matplotlib/examples/quadmesh_demo.py
trunk/matplotlib/examples/scatter_masked.py
trunk/matplotlib/examples/step_demo.py
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/cm.py
trunk/matplotlib/lib/matplotlib/colors.py
trunk/matplotlib/lib/matplotlib/contour.py
trunk/matplotlib/lib/matplotlib/image.py
trunk/matplotlib/lib/matplotlib/lines.py
trunk/matplotlib/lib/matplotlib/path.py
trunk/matplotlib/lib/matplotlib/pylab.py
trunk/matplotlib/lib/matplotlib/quiver.py
trunk/matplotlib/lib/matplotlib/scale.py
trunk/matplotlib/lib/matplotlib/transforms.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-03-19 18:07:49 UTC (rev 5007)
+++ trunk/matplotlib/CHANGELOG 2008-03-20 03:30:58 UTC (rev 5008)
@@ -1,7 +1,14 @@
-2008-03-14 Removed an apparently unnecessary call to
- FigureCanvasAgg.draw in backend_qt*agg. Thanks to Ted
- Drain - DSD
+2008-03-19 Changed ma import statements to "from numpy import ma";
+ this should work with past and future versions of
+ numpy, whereas "import numpy.ma as ma" will work only
+ with numpy >= 1.05, and "import numerix.npyma as ma"
+ is obsolete now that maskedarray is replacing the
+ earlier implementation, as of numpy 1.05.
+2008-03-14 Removed an apparently unnecessary call to
+ FigureCanvasAgg.draw in backend_qt*agg. Thanks to Ted
+ Drain - DSD
+
2008-03-10 Workaround a bug in backend_qt4agg's blitting due to a
buffer width/bbox width mismatch in _backend_agg's
copy_from_bbox - DSD
Modified: trunk/matplotlib/CODING_GUIDE
===================================================================
--- trunk/matplotlib/CODING_GUIDE 2008-03-19 18:07:49 UTC (rev 5007)
+++ trunk/matplotlib/CODING_GUIDE 2008-03-20 03:30:58 UTC (rev 5008)
@@ -12,7 +12,7 @@
# checking out the main src
svn co
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib
matplotlib --username=youruser --password=yourpass
-# branch checkouts, eg the transforms branch
+# branch checkouts, eg the transforms branch
svn co
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/transforms
transbranch
== Committing changes ==
@@ -47,15 +47,18 @@
import numpy as npy
a = npy.array([1,2,3])
-
+
For masked arrays, use:
- import matplotlib.numerix.npyma as ma
+ from numpy import ma
- (This is needed to support the maskedarray module as an
- alternative to the original numpy ma module; eventually,
- the maskedarray implementation is likely to replace the
- ma implementation.)
+ (The earlier recommendation, 'import matplotlib.numerix.npyma as ma',
+ was needed temporarily during the development of the maskedarray
+ implementation as a separate package. As of numpy 1.05, it
+ replaces the old implementation.
+ Note: "from numpy import ma" works with numpy < 1.05 *and* with
+ numpy >= 1.05. "import numpy.ma as ma" works *only* with
+ numpy >= 1.05, so for now we must not use it.)
For matplotlib main module, use:
@@ -64,8 +67,8 @@
For matplotlib modules (or any other modules), use:
- import matplotlib.cbook as cbook
-
+ import matplotlib.cbook as cbook
+
if cbook.iterable(z):
pass
@@ -125,7 +128,7 @@
(add-hook 'python-mode-hook
(lambda ()
- (add-hook 'local-write-file-hooks 'delete-trailing-whitespace)))
+ (add-hook 'local-write-file-hooks 'delete-trailing-whitespace)))
Modified: trunk/matplotlib/examples/color_by_yvalue.py
===================================================================
--- trunk/matplotlib/examples/color_by_yvalue.py 2008-03-19 18:07:49 UTC
(rev 5007)
+++ trunk/matplotlib/examples/color_by_yvalue.py 2008-03-20 03:30:58 UTC
(rev 5008)
@@ -1,6 +1,6 @@
# use masked arrays to plot a line with different colors by y-value
-import matplotlib.numerix.npyma as ma
from numpy import logical_or, arange, sin, pi
+from numpy import ma
from matplotlib.pyplot import plot, show
t = arange(0.0, 2.0, 0.01)
Modified: trunk/matplotlib/examples/contourf_demo.py
===================================================================
--- trunk/matplotlib/examples/contourf_demo.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/examples/contourf_demo.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -1,6 +1,5 @@
#!/usr/bin/env python
from pylab import *
-import matplotlib.numerix.npyma as ma
origin = 'lower'
#origin = 'upper'
Modified: trunk/matplotlib/examples/dynamic_collection.py
===================================================================
--- trunk/matplotlib/examples/dynamic_collection.py 2008-03-19 18:07:49 UTC
(rev 5007)
+++ trunk/matplotlib/examples/dynamic_collection.py 2008-03-20 03:30:58 UTC
(rev 5008)
@@ -12,8 +12,8 @@
facecolors = [cm.jet(0.5)]
collection = RegularPolyCollection(
- fig.dpi,
- numsides=5, # a pentagon
+ #fig.dpi,
+ 5, # a pentagon
rotation=0,
sizes=(50,),
facecolors = facecolors,
Modified: trunk/matplotlib/examples/image_masked.py
===================================================================
--- trunk/matplotlib/examples/image_masked.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/examples/image_masked.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -6,7 +6,7 @@
'''
from pylab import *
-import matplotlib.numerix.npyma as ma
+from numpy import ma
import matplotlib.colors as colors
delta = 0.025
Modified: trunk/matplotlib/examples/masked_demo.py
===================================================================
--- trunk/matplotlib/examples/masked_demo.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/examples/masked_demo.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -6,7 +6,6 @@
break the line at the data gaps.
'''
-import matplotlib.numerix.npyma as ma
from pylab import *
x = ma.arange(0, 2*pi, 0.02)
Modified: trunk/matplotlib/examples/quadmesh_demo.py
===================================================================
--- trunk/matplotlib/examples/quadmesh_demo.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/examples/quadmesh_demo.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -9,7 +9,7 @@
import numpy as npy
from matplotlib.pyplot import figure, show, savefig
from matplotlib import cm, colors
-from matplotlib.numerix import npyma as ma
+from numpy import ma
n = 56
x = npy.linspace(-1.5,1.5,n)
Modified: trunk/matplotlib/examples/scatter_masked.py
===================================================================
--- trunk/matplotlib/examples/scatter_masked.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/examples/scatter_masked.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -1,6 +1,5 @@
#!/usr/bin/env python
from pylab import *
-import matplotlib.numerix.npyma as ma
N = 100
r0 = 0.6
Modified: trunk/matplotlib/examples/step_demo.py
===================================================================
--- trunk/matplotlib/examples/step_demo.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/examples/step_demo.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -1,5 +1,5 @@
import numpy as npy
-from matplotlib.numerix import npyma as ma
+from numpy import ma
from matplotlib.pyplot import step, legend, xlim, ylim, show
x = npy.arange(1, 7, 0.4)
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -2,9 +2,8 @@
import math, warnings, new
import numpy as npy
+from numpy import ma
-import matplotlib.numerix.npyma as ma
-
import matplotlib
rcParams = matplotlib.rcParams
Modified: trunk/matplotlib/lib/matplotlib/cm.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cm.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/lib/matplotlib/cm.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -3,9 +3,9 @@
"""
import numpy as npy
+from numpy import ma
import matplotlib as mpl
import matplotlib.colors as colors
-import matplotlib.numerix.npyma as ma
import matplotlib.cbook as cbook
from matplotlib._cm import *
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/lib/matplotlib/colors.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -35,7 +35,7 @@
"""
import re
import numpy as npy
-import matplotlib.numerix.npyma as ma
+from numpy import ma
import matplotlib.cbook as cbook
cnames = {
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -6,7 +6,7 @@
import warnings
import matplotlib as mpl
import numpy as npy
-import matplotlib.numerix.npyma as ma
+from numpy import ma
import matplotlib._cntr as _cntr
import matplotlib.path as path
import matplotlib.ticker as ticker
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/lib/matplotlib/image.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -7,9 +7,8 @@
import os, warnings
import numpy as npy
+from numpy import ma
-import matplotlib.numerix.npyma as ma
-
from matplotlib import rcParams
from matplotlib import artist as martist
from matplotlib import colors as mcolors
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/lib/matplotlib/lines.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -7,8 +7,7 @@
from __future__ import division
import numpy as npy
-
-from matplotlib.numerix import npyma as ma
+from numpy import ma
from matplotlib import verbose
import artist
from artist import Artist
Modified: trunk/matplotlib/lib/matplotlib/path.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/path.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/lib/matplotlib/path.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -8,7 +8,7 @@
from weakref import WeakValueDictionary
import numpy as npy
-from matplotlib.numerix import npyma as ma
+from numpy import ma
from matplotlib._path import point_in_path, get_path_extents, \
point_in_path_collection, get_path_collection_extents, \
Modified: trunk/matplotlib/lib/matplotlib/pylab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pylab.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/lib/matplotlib/pylab.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -198,12 +198,7 @@
silent_list, iterable, enumerate, dedent
import numpy as npy
-# The masked array namespace is brought in as ma; getting
-# this from numerix allows one to select either numpy.ma or
-# Pierre G-M's maskedarray implementation, which may
-# replace the present numpy.ma implementation in a future
-# numpy release.
-from matplotlib.numerix import npyma as ma
+from numpy import ma
from matplotlib import mpl # pulls in most modules
Modified: trunk/matplotlib/lib/matplotlib/quiver.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/quiver.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/lib/matplotlib/quiver.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -143,7 +143,7 @@
"""
import numpy as npy
-import matplotlib.numerix.npyma as ma
+from numpy import ma
import matplotlib.collections as collections
import matplotlib.transforms as transforms
import matplotlib.text as text
Modified: trunk/matplotlib/lib/matplotlib/scale.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/scale.py 2008-03-19 18:07:49 UTC (rev
5007)
+++ trunk/matplotlib/lib/matplotlib/scale.py 2008-03-20 03:30:58 UTC (rev
5008)
@@ -1,6 +1,6 @@
import textwrap
import numpy as npy
-from matplotlib.numerix import npyma as ma
+from numpy import ma
MaskedArray = ma.MaskedArray
from cbook import dedent
Modified: trunk/matplotlib/lib/matplotlib/transforms.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/transforms.py 2008-03-19 18:07:49 UTC
(rev 5007)
+++ trunk/matplotlib/lib/matplotlib/transforms.py 2008-03-20 03:30:58 UTC
(rev 5008)
@@ -24,7 +24,7 @@
"""
import numpy as npy
-from matplotlib.numerix import npyma as ma
+from numpy import ma
from matplotlib._path import affine_transform
from numpy.linalg import inv
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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins