Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit afa74dc

Browse files
committed
Updated the importation of numpy.ma; numerix.npyma is obsolete.
svn path=/trunk/matplotlib/; revision=5008
1 parent 22dcc31 commit afa74dc

21 files changed

Lines changed: 40 additions & 41 deletions

CHANGELOG

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
2008-03-14 Removed an apparently unnecessary call to
2-
FigureCanvasAgg.draw in backend_qt*agg. Thanks to Ted
3-
Drain - DSD
1+
2008-03-19 Changed ma import statements to "from numpy import ma";
2+
this should work with past and future versions of
3+
numpy, whereas "import numpy.ma as ma" will work only
4+
with numpy >= 1.05, and "import numerix.npyma as ma"
5+
is obsolete now that maskedarray is replacing the
6+
earlier implementation, as of numpy 1.05.
7+
8+
2008-03-14 Removed an apparently unnecessary call to
9+
FigureCanvasAgg.draw in backend_qt*agg. Thanks to Ted
10+
Drain - DSD
411

512
2008-03-10 Workaround a bug in backend_qt4agg's blitting due to a
613
buffer width/bbox width mismatch in _backend_agg's

CODING_GUIDE

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk matplotli
1212
# checking out the main src
1313
svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib --username=youruser --password=yourpass
1414

15-
# branch checkouts, eg the transforms branch
15+
# branch checkouts, eg the transforms branch
1616
svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/transforms transbranch
1717

1818
== Committing changes ==
@@ -47,15 +47,18 @@ For numpy, use:
4747

4848
import numpy as npy
4949
a = npy.array([1,2,3])
50-
50+
5151

5252
For masked arrays, use:
53-
import matplotlib.numerix.npyma as ma
53+
from numpy import ma
5454

55-
(This is needed to support the maskedarray module as an
56-
alternative to the original numpy ma module; eventually,
57-
the maskedarray implementation is likely to replace the
58-
ma implementation.)
55+
(The earlier recommendation, 'import matplotlib.numerix.npyma as ma',
56+
was needed temporarily during the development of the maskedarray
57+
implementation as a separate package. As of numpy 1.05, it
58+
replaces the old implementation.
59+
Note: "from numpy import ma" works with numpy < 1.05 *and* with
60+
numpy >= 1.05. "import numpy.ma as ma" works *only* with
61+
numpy >= 1.05, so for now we must not use it.)
5962

6063
For matplotlib main module, use:
6164

@@ -64,8 +67,8 @@ For matplotlib main module, use:
6467

6568
For matplotlib modules (or any other modules), use:
6669

67-
import matplotlib.cbook as cbook
68-
70+
import matplotlib.cbook as cbook
71+
6972
if cbook.iterable(z):
7073
pass
7174

@@ -125,7 +128,7 @@ for older versions of emacs (emacs<22) you need to do
125128

126129
(add-hook 'python-mode-hook
127130
(lambda ()
128-
(add-hook 'local-write-file-hooks 'delete-trailing-whitespace)))
131+
(add-hook 'local-write-file-hooks 'delete-trailing-whitespace)))
129132

130133

131134

examples/color_by_yvalue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# use masked arrays to plot a line with different colors by y-value
2-
import matplotlib.numerix.npyma as ma
32
from numpy import logical_or, arange, sin, pi
3+
from numpy import ma
44
from matplotlib.pyplot import plot, show
55

66
t = arange(0.0, 2.0, 0.01)

examples/contourf_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python
22
from pylab import *
3-
import matplotlib.numerix.npyma as ma
43
origin = 'lower'
54
#origin = 'upper'
65

examples/dynamic_collection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
facecolors = [cm.jet(0.5)]
1313

1414
collection = RegularPolyCollection(
15-
fig.dpi,
16-
numsides=5, # a pentagon
15+
#fig.dpi,
16+
5, # a pentagon
1717
rotation=0,
1818
sizes=(50,),
1919
facecolors = facecolors,

examples/image_masked.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'''
77

88
from pylab import *
9-
import matplotlib.numerix.npyma as ma
9+
from numpy import ma
1010
import matplotlib.colors as colors
1111

1212
delta = 0.025

examples/masked_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
break the line at the data gaps.
77
'''
88

9-
import matplotlib.numerix.npyma as ma
109
from pylab import *
1110

1211
x = ma.arange(0, 2*pi, 0.02)

examples/quadmesh_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import numpy as npy
1010
from matplotlib.pyplot import figure, show, savefig
1111
from matplotlib import cm, colors
12-
from matplotlib.numerix import npyma as ma
12+
from numpy import ma
1313

1414
n = 56
1515
x = npy.linspace(-1.5,1.5,n)

examples/scatter_masked.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python
22
from pylab import *
3-
import matplotlib.numerix.npyma as ma
43

54
N = 100
65
r0 = 0.6

examples/step_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import numpy as npy
2-
from matplotlib.numerix import npyma as ma
2+
from numpy import ma
33
from matplotlib.pyplot import step, legend, xlim, ylim, show
44

55
x = npy.arange(1, 7, 0.4)

0 commit comments

Comments
 (0)