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

Skip to content

Commit b2b5397

Browse files
committed
Merged revisions 4786-4800 via svnmerge from
http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4788 | efiring | 2007-12-26 02:23:27 -0500 (Wed, 26 Dec 2007) | 7 lines Make numerix.ma and numerix.npyma work with numpy 1.05 The numpy maskedarray branch is scheduled to become the trunk for 1.05. It includes a change from ma.py being in numpy/core to ma being a module under numpy, so the import syntax is different in numerix.ma and numerix.npyma. ........ r4789 | efiring | 2007-12-26 02:51:19 -0500 (Wed, 26 Dec 2007) | 2 lines Fix bug in errorbar, reported by Noriko Minakawa ........ r4790 | efiring | 2007-12-26 12:10:34 -0500 (Wed, 26 Dec 2007) | 2 lines Warning instead of exception if matplotlib.use() is called too late. ........ svn path=/branches/transforms/; revision=4801
1 parent ce9bade commit b2b5397

5 files changed

Lines changed: 27 additions & 5 deletions

File tree

CHANGELOG

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2007-12-26 Reduce too-late use of matplotlib.use() to a warning
2+
instead of an exception, for backwards compatibility - EF
3+
4+
2007-12-25 Fix bug in errorbar, identified by Noriko Minakawa - EF
5+
6+
2007-12-25 Changed masked array importing to work with the upcoming
7+
numpy 1.05 (now the maskedarray branch) as well as with
8+
earlier versions. - EF
9+
110
2007-12-16 rec2csv saves doubles without losing precision. Also, it
211
does not close filehandles passed in open. - JDH,ADS
312

lib/matplotlib/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,11 @@ def rcdefaults():
727727
except:
728728
from config import rcParams, rcdefaults
729729

730-
_use_error_msg = """ matplotlib.use() must be called *before* pylab
731-
or matplotlib.backends is imported for the first time."""
730+
_use_error_msg = """ This call to matplotlib.use() has no effect
731+
because the the backend has already been chosen;
732+
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
733+
or matplotlib.backends is imported for the first time.
734+
"""
732735

733736
def use(arg):
734737
"""
@@ -747,7 +750,7 @@ def use(arg):
747750
be called before importing matplotlib.backends.
748751
"""
749752
if 'matplotlib.backends' in sys.modules:
750-
raise RuntimeError(_use_error_msg)
753+
warnings.warn(_use_error_msg)
751754
be_parts = arg.split('.')
752755
name = validate_backend(be_parts[0])
753756
rcParams['backend'] = name

lib/matplotlib/axes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3779,6 +3779,8 @@ def errorbar(self, x, y, yerr=None, xerr=None,
37793779
lines_kw['linewidth']=kwargs['linewidth']
37803780
if 'lw' in kwargs:
37813781
lines_kw['lw']=kwargs['lw']
3782+
if 'transform' in kwargs:
3783+
lines_kw['transform'] = kwargs['transform']
37823784

37833785
# arrays fine here, they are booleans and hence not units
37843786
if not iterable(lolims):
@@ -3814,6 +3816,8 @@ def xywhere(xs, ys, mask):
38143816
plot_kw['markeredgewidth']=kwargs['markeredgewidth']
38153817
if 'mew' in kwargs:
38163818
plot_kw['mew']=kwargs['mew']
3819+
if 'transform' in kwargs:
3820+
plot_kw['transform'] = kwargs['transform']
38173821

38183822
if xerr is not None:
38193823
if iterable(xerr) and len(xerr)==2 and iterable(xerr[0]) and iterable(xerr[1]):

lib/matplotlib/numerix/ma/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
from maskedarray import *
1414
print "using maskedarray"
1515
else:
16-
from numpy.core.ma import *
16+
try:
17+
from numpy.ma import * # numpy 1.05 and later
18+
except ImportError:
19+
from numpy.core.ma import * # earlier
1720
#print "using ma"
1821
def getmaskorNone(obj):
1922
_msk = getmask(obj)

lib/matplotlib/numerix/npyma/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
from maskedarray import *
55
print "using maskedarray"
66
else:
7-
from numpy.core.ma import *
7+
try:
8+
from numpy.ma import * # numpy 1.05 and later
9+
except ImportError:
10+
from numpy.core.ma import * # earlier
811
#print "using ma"

0 commit comments

Comments
 (0)