You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <md...@us...> - 2008-03-21 13:10:23
|
Revision: 5011
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5011&view=rev
Author: mdboom
Date: 2008-03-21 06:10:20 -0700 (Fri, 21 Mar 2008)
Log Message:
-----------
Bugfix: [ 1912719 ] TypeError in Exception __get_configdir()
Thanks, Andrea Tomasini
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/__init__.py
Modified: branches/v0_91_maint/lib/matplotlib/__init__.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/__init__.py 2008-03-20 20:30:44 UTC (rev 5010)
+++ branches/v0_91_maint/lib/matplotlib/__init__.py 2008-03-21 13:10:20 UTC (rev 5011)
@@ -397,7 +397,7 @@
if os.path.exists(p):
if not _is_writable_dir(p):
- raise RuntimeError("'%s' is not a writable dir; you must set %s/.matplotlib to be a writable dir. You can also set environment variable MPLCONFIGDIR to any writable directory where you want matplotlib data stored "%h)
+ raise RuntimeError("'%s' is not a writable dir; you must set %s/.matplotlib to be a writable dir. You can also set environment variable MPLCONFIGDIR to any writable directory where you want matplotlib data stored "% (h, h))
else:
if not _is_writable_dir(h):
raise RuntimeError("Failed to create %s/.matplotlib; consider setting MPLCONFIGDIR to a writable directory for matplotlib configuration data"%h)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mme...@us...> - 2008-03-20 20:30:49
|
Revision: 5010
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5010&view=rev
Author: mmetz_bn
Date: 2008-03-20 13:30:44 -0700 (Thu, 20 Mar 2008)
Log Message:
-----------
Bugfix in ContourSet._process_linestyles
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/contour.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-03-20 16:57:41 UTC (rev 5009)
+++ trunk/matplotlib/CHANGELOG 2008-03-20 20:30:44 UTC (rev 5010)
@@ -1,3 +1,6 @@
+2008-03-20 Fixed a minor bug in ContourSet._process_linestyles when
+ len(linestyles)==Nlev - MM
+
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
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2008-03-20 16:57:41 UTC (rev 5009)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2008-03-20 20:30:44 UTC (rev 5010)
@@ -713,7 +713,7 @@
else:
if cbook.is_string_like(linestyles):
tlinestyles = [linestyles] * Nlev
- elif cbook.iterable(linestyles) and len(linestyles) < Nlev:
+ elif cbook.iterable(linestyles) and len(linestyles) <= Nlev:
tlinestyles = list(linestyles) * int(npy.ceil(Nlev/len(linestyles)))
return tlinestyles
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mme...@us...> - 2008-03-20 16:57:42
|
Revision: 5009
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5009&view=rev
Author: mmetz_bn
Date: 2008-03-20 09:57:41 -0700 (Thu, 20 Mar 2008)
Log Message:
-----------
scatter docs fixed
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-03-20 03:30:58 UTC (rev 5008)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-03-20 16:57:41 UTC (rev 5009)
@@ -4172,6 +4172,8 @@
'p' : pentagram
'h' : hexagon
'8' : octagon
+ '+' : plus
+ 'x' : cross
The marker can also be a tuple (numsides, style, angle), which will
create a custom, regular symbol.
@@ -4188,18 +4190,6 @@
Finally, marker can be (verts, 0), verts is a sequence of (x,y)
vertices for a custom scatter symbol.
- numsides is the number of sides
-
- style is the style of the regular symbol:
- 0 : a regular polygon
- 1 : a star-like symbol
- 2 : an asterisk
-
- angle is the angle of rotation of the symbol
-
- Finally, marker can be (verts, 0), verts is a sequence of (x,y)
- vertices for a custom scatter symbol.
-
s is a size argument in points squared.
Any or all of x, y, s, and c may be masked arrays, in which
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-03-20 03:31:00
|
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.
|
|
From: <sa...@us...> - 2008-03-19 18:07:59
|
Revision: 5007
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5007&view=rev
Author: sameerd
Date: 2008-03-19 11:07:49 -0700 (Wed, 19 Mar 2008)
Log Message:
-----------
Added outerjoin, lefjoin and rightjoin support to rec_join
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mlab.py
Added Paths:
-----------
trunk/matplotlib/examples/rec_join_demo.py
Added: trunk/matplotlib/examples/rec_join_demo.py
===================================================================
--- trunk/matplotlib/examples/rec_join_demo.py (rev 0)
+++ trunk/matplotlib/examples/rec_join_demo.py 2008-03-19 18:07:49 UTC (rev 5007)
@@ -0,0 +1,27 @@
+import numpy as np
+import matplotlib.mlab as mlab
+
+
+r = mlab.csv2rec('data/aapl.csv')
+r.sort()
+r1 = r[-10:]
+
+# Create a new array
+r2 = np.empty(12, dtype=[('date', '|O4'), ('high', np.float),
+ ('marker', np.float)])
+r2 = r2.view(np.recarray)
+r2.date = r.date[-17:-5]
+r2.high = r.high[-17:-5]
+r2.marker = np.arange(12)
+
+print "r1:"
+print mlab.rec2txt(r1)
+print "r2:"
+print mlab.rec2txt(r2)
+
+defaults = {'marker':-1, 'close':np.NaN, 'low':-4444.}
+
+for s in ('inner', 'outer', 'leftouter'):
+ rec = mlab.rec_join(['date', 'high'], r1, r2,
+ jointype=s, defaults=defaults)
+ print "\n%sjoin :\n%s" % (s, mlab.rec2txt(rec))
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py 2008-03-19 14:36:57 UTC (rev 5006)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-03-19 18:07:49 UTC (rev 5007)
@@ -2044,12 +2044,19 @@
return npy.rec.fromarrays(arrays, names=names)
-def rec_join(key, r1, r2):
+
+def rec_join(key, r1, r2, jointype='inner', defaults=None):
"""
join record arrays r1 and r2 on key; key is a tuple of field
names. if r1 and r2 have equal values on all the keys in the key
tuple, then their fields will be merged into a new record array
containing the intersection of the fields of r1 and r2
+
+ The jointype keyword can be 'inner', 'outer', 'leftouter'.
+ To do a rightouter join just reverse r1 and r2.
+
+ The defaults keyword is a dictionary filled with
+ {column_name:default_value} pairs.
"""
for name in key:
@@ -2067,17 +2074,22 @@
r1keys = set(r1d.keys())
r2keys = set(r2d.keys())
- keys = r1keys & r2keys
+ common_keys = r1keys & r2keys
- r1ind = npy.array([r1d[k] for k in keys])
- r2ind = npy.array([r2d[k] for k in keys])
+ r1ind = npy.array([r1d[k] for k in common_keys])
+ r2ind = npy.array([r2d[k] for k in common_keys])
- # Make sure that the output rows have the same relative order as r1
- sortind = r1ind.argsort()
+ common_len = len(common_keys)
+ left_len = right_len = 0
+ if jointype == "outer" or jointype == "leftouter":
+ left_keys = r1keys.difference(r2keys)
+ left_ind = npy.array([r1d[k] for k in left_keys])
+ left_len = len(left_ind)
+ if jointype == "outer":
+ right_keys = r2keys.difference(r1keys)
+ right_ind = npy.array([r2d[k] for k in right_keys])
+ right_len = len(right_ind)
- r1 = r1[r1ind[sortind]]
- r2 = r2[r2ind[sortind]]
-
r2 = rec_drop_fields(r2, r1.dtype.names)
@@ -2103,13 +2115,31 @@
[desc for desc in r2.dtype.descr if desc[0] not in key ] )
- newrec = npy.empty(len(r1), dtype=newdtype)
+ newrec = npy.empty(common_len + left_len + right_len, dtype=newdtype)
+
+ if jointype != 'inner' and defaults is not None: # fill in the defaults enmasse
+ newrec_fields = newrec.dtype.fields.keys()
+ for k, v in defaults.items():
+ if k in newrec_fields:
+ newrec[k] = v
+
for field in r1.dtype.names:
- newrec[field] = r1[field]
+ newrec[field][:common_len] = r1[field][r1ind]
+ if jointype == "outer" or jointype == "leftouter":
+ newrec[field][common_len:(common_len+left_len)] = r1[field][left_ind]
for field in r2.dtype.names:
- newrec[field] = r2[field]
+ newrec[field][:common_len] = r2[field][r2ind]
+ if jointype == "outer":
+ newrec[field][-right_len:] = r2[field][right_ind[right_ind.argsort()]]
+ # sort newrec using the same order as r1
+ sort_indices = r1ind.copy()
+ if jointype == "outer" or jointype == "leftouter":
+ sort_indices = npy.append(sort_indices, left_ind)
+ newrec[:(common_len+left_len)] = newrec[sort_indices.argsort()]
+
+
return newrec.view(npy.recarray)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-03-19 14:37:02
|
Revision: 5006
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5006&view=rev
Author: dsdale
Date: 2008-03-19 07:36:57 -0700 (Wed, 19 Mar 2008)
Log Message:
-----------
fix cursor mapping in backend_qt4
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-03-19 13:13:05 UTC (rev 5005)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-03-19 14:36:57 UTC (rev 5006)
@@ -21,8 +21,8 @@
DEBUG = False
cursord = {
- cursors.MOVE : QtCore.Qt.PointingHandCursor,
- cursors.HAND : QtCore.Qt.WaitCursor,
+ cursors.MOVE : QtCore.Qt.SizeAllCursor,
+ cursors.HAND : QtCore.Qt.PointingHandCursor,
cursors.POINTER : QtCore.Qt.ArrowCursor,
cursors.SELECT_REGION : QtCore.Qt.CrossCursor,
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-03-19 13:14:03
|
Revision: 5005
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5005&view=rev
Author: dsdale
Date: 2008-03-19 06:13:05 -0700 (Wed, 19 Mar 2008)
Log Message:
-----------
minor tweaks to filesave.svg
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mpl-data/images/filesave.svg
Modified: trunk/matplotlib/lib/matplotlib/mpl-data/images/filesave.svg
===================================================================
--- trunk/matplotlib/lib/matplotlib/mpl-data/images/filesave.svg 2008-03-18 18:46:07 UTC (rev 5004)
+++ trunk/matplotlib/lib/matplotlib/mpl-data/images/filesave.svg 2008-03-19 13:13:05 UTC (rev 5005)
@@ -1,428 +1,450 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
-"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"
-[
- <!ATTLIST svg
- xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink">
-]>
-<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ version="1.0"
width="128pt"
height="128pt"
- id="svg1"
- sodipodi:version="0.27"
- sodipodi:docname="/mnt/windows/Themes/Work/Blue-Sphere/filesave.svg"
- sodipodi:docbase="/mnt/windows/Themes/Work/Blue-Sphere/"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:xlink="http://www.w3.org/1999/xlink">
+ id="svg1">
<defs
id="defs22">
<linearGradient
id="linearGradient408">
<stop
- offset="0.000000"
- style="stop-color:#fbddb2;stop-opacity:0.992157;"
- id="stop409" />
+ id="stop409"
+ style="stop-color:#fbddb2;stop-opacity:0.99215698"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#efa81a;stop-opacity:0.952941;"
- id="stop410" />
+ id="stop410"
+ style="stop-color:#efa81a;stop-opacity:0.952941"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient458">
<stop
- offset="0.000000"
- style="stop-color:#cdffff;stop-opacity:0.690196;"
- id="stop459" />
+ id="stop459"
+ style="stop-color:#cdffff;stop-opacity:0.69019598"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#0c5c7d;stop-opacity:0.780392;"
- id="stop460" />
+ id="stop460"
+ style="stop-color:#0c5c7d;stop-opacity:0.78039199"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient320">
<stop
- offset="0.000000"
- style="stop-color:#5f9eb2;stop-opacity:0.882353;"
- id="stop321" />
+ id="stop321"
+ style="stop-color:#5f9eb2;stop-opacity:0.88235301"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#0c5c7d;stop-opacity:0.870588;"
- id="stop322" />
+ id="stop322"
+ style="stop-color:#0c5c7d;stop-opacity:0.870588"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient314">
<stop
- offset="0.000000"
- style="stop-color:#0c5c7d;stop-opacity:1;"
- id="stop315" />
+ id="stop315"
+ style="stop-color:#0c5c7d;stop-opacity:1"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#0c5c7d;stop-opacity:1;"
- id="stop316" />
+ id="stop316"
+ style="stop-color:#0c5c7d;stop-opacity:1"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient310">
<stop
- offset="0.000000"
- style="stop-color:#0c5c7d;stop-opacity:0.780392;"
- id="stop311" />
+ id="stop311"
+ style="stop-color:#0c5c7d;stop-opacity:0.78039199"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#cdffff;stop-opacity:0.690196;"
- id="stop312" />
+ id="stop312"
+ style="stop-color:#cdffff;stop-opacity:0.69019598"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient307">
<stop
- offset="0.000000"
- style="stop-color:#cdffff;stop-opacity:1;"
- id="stop308" />
+ id="stop308"
+ style="stop-color:#cdffff;stop-opacity:1"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#0c5c7d;stop-opacity:1;"
- id="stop309" />
+ id="stop309"
+ style="stop-color:#0c5c7d;stop-opacity:1"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient291">
<stop
- offset="0.000000"
- style="stop-color:#0c5c7d;stop-opacity:0.615686;"
- id="stop292" />
+ id="stop292"
+ style="stop-color:#0c5c7d;stop-opacity:0.615686"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#004468;stop-opacity:0.917647;"
- id="stop293" />
+ id="stop293"
+ style="stop-color:#004468;stop-opacity:0.917647"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient235">
<stop
- offset="0.000000"
- style="stop-color:#eaffff;stop-opacity:1;"
- id="stop236" />
+ id="stop236"
+ style="stop-color:#eaffff;stop-opacity:1"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#97e2ff;stop-opacity:0.992157;"
- id="stop237" />
+ id="stop237"
+ style="stop-color:#97e2ff;stop-opacity:0.99215698"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient232">
<stop
- offset="0.000000"
- style="stop-color:#fcfcfc;stop-opacity:1;"
- id="stop233" />
+ id="stop233"
+ style="stop-color:#fcfcfc;stop-opacity:1"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#afb2b5;stop-opacity:1;"
- id="stop234" />
+ id="stop234"
+ style="stop-color:#afb2b5;stop-opacity:1"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient216">
<stop
- offset="0.000000"
- style="stop-color:#f5f5f5;stop-opacity:1;"
- id="stop217" />
+ id="stop217"
+ style="stop-color:#f5f5f5;stop-opacity:1"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#949494;stop-opacity:1;"
- id="stop218" />
+ id="stop218"
+ style="stop-color:#949494;stop-opacity:1"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient211">
<stop
- offset="0.000000"
- style="stop-color:#d7ffff;stop-opacity:0.458824;"
- id="stop212" />
+ id="stop212"
+ style="stop-color:#d7ffff;stop-opacity:0.45882401"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#2ea6b9;stop-opacity:0.823529;"
- id="stop213" />
+ id="stop213"
+ style="stop-color:#2ea6b9;stop-opacity:0.82352901"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient168">
<stop
- offset="0.000000"
- style="stop-color:#cdffff;stop-opacity:0.87451;"
- id="stop169" />
+ id="stop169"
+ style="stop-color:#cdffff;stop-opacity:0.87450999"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#0c5c7d;stop-opacity:0.866667;"
- id="stop170" />
+ id="stop170"
+ style="stop-color:#0c5c7d;stop-opacity:0.86666697"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient90">
<stop
- offset="0.000000"
- style="stop-color:#cdffff;stop-opacity:1;"
- id="stop91" />
+ id="stop91"
+ style="stop-color:#cdffff;stop-opacity:1"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#006b97;stop-opacity:0.905882;"
- id="stop92" />
+ id="stop92"
+ style="stop-color:#006b97;stop-opacity:0.905882"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient67">
<stop
- offset="0.000000"
- style="stop-color:#d7ffff;stop-opacity:0.898039;"
- id="stop70" />
+ id="stop70"
+ style="stop-color:#d7ffff;stop-opacity:0.89803898"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#2ea6b9;stop-opacity:0.952941;"
- id="stop69" />
+ id="stop69"
+ style="stop-color:#2ea6b9;stop-opacity:0.952941"
+ offset="1" />
</linearGradient>
<linearGradient
id="linearGradient57">
<stop
- offset="0.000000"
- style="stop-color:#ffffff;stop-opacity:1;"
- id="stop59" />
+ id="stop59"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
<stop
- offset="1.000000"
- style="stop-color:#797979;stop-opacity:1;"
- id="stop58" />
+ id="stop58"
+ style="stop-color:#797979;stop-opacity:1"
+ offset="1" />
</linearGradient>
<defs
id="defs4">
<radialGradient
+ cx="869.60303"
+ cy="1973.58"
+ r="2106.6499"
+ fx="869.60303"
+ fy="1973.58"
id="1"
- cx="869.603027"
- cy="1973.579956"
- r="2106.649902"
- fx="869.603027"
- fy="1973.579956"
- gradientUnits="userSpaceOnUse"
- xlink:href="#linearGradient67" />
+ xlink:href="#linearGradient67"
+ gradientUnits="userSpaceOnUse" />
</defs>
<defs
id="defs11">
<linearGradient
- id="2"
- x1="255.848"
+ x1="255.84801"
y1="119.147"
x2="375.686"
- y2="34.1009"
+ y2="34.100899"
+ id="2"
gradientUnits="userSpaceOnUse">
<stop
- offset="0"
- style="stop-color:#ffffff"
- id="stop13" />
+ id="stop13"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
<stop
- offset="1"
- style="stop-color:#000000"
- id="stop14" />
+ id="stop14"
+ style="stop-color:#000000;stop-opacity:1"
+ offset="1" />
</linearGradient>
</defs>
<defs
id="defs16">
<linearGradient
+ x1="275.05301"
+ y1="109.384"
+ x2="356.48099"
+ y2="30.8643"
id="3"
- x1="275.053009"
- y1="109.384003"
- x2="356.480988"
- y2="30.864300"
- gradientUnits="userSpaceOnUse"
- xlink:href="#linearGradient57" />
+ xlink:href="#linearGradient57"
+ gradientUnits="userSpaceOnUse" />
</defs>
<radialGradient
- xlink:href="#linearGradient291"
- id="radialGradient88"
- cx="7.8608e-19"
+ cx="7.8608002e-19"
cy="1.31835e-24"
- fx="7.8608e-19"
+ r="0.56394601"
+ fx="7.8608002e-19"
fy="1.31835e-24"
- r="0.563946"
+ id="radialGradient88"
+ xlink:href="#linearGradient291"
gradientUnits="objectBoundingBox"
gradientTransform="matrix(1.18884,0.249702,0,0.841157,0.2,0.299442)"
spreadMethod="pad" />
<linearGradient
- xlink:href="#linearGradient310"
- id="linearGradient89"
x1="-0.258715"
y1="-0.109747"
x2="0.241703"
y2="1.23657"
+ id="linearGradient89"
+ xlink:href="#linearGradient310"
gradientUnits="objectBoundingBox"
- gradientTransform="matrix(1.72489,1.17189,-0.0575163,0.540671,0.503708,0.486073)"
+ gradientTransform="matrix(1.72489,1.17189,-5.75163e-2,0.540671,0.503708,0.486073)"
spreadMethod="pad" />
<linearGradient
- xlink:href="#linearGradient408"
- id="linearGradient210"
x1="0.240647"
- y1="1.19614"
+ y1="1.1961401"
x2="0.248069"
y2="-0.301604"
+ id="linearGradient210"
+ xlink:href="#linearGradient408"
gradientUnits="objectBoundingBox"
- gradientTransform="matrix(0.945877,-1.683e-07,5.89965e-08,1.05722,0.264368,0.249996)"
+ gradientTransform="matrix(0.945877,-1.683e-7,5.89965e-8,1.05722,0.264368,0.249996)"
spreadMethod="pad" />
<linearGradient
- xlink:href="#linearGradient320"
- id="linearGradient215"
x1="0"
y1="0"
x2="1"
y2="0"
+ id="linearGradient215"
+ xlink:href="#linearGradient320"
gradientUnits="objectBoundingBox"
- gradientTransform="matrix(1,3.24414e-08,0,1,4.00643e-08,4.14905e-08)"
spreadMethod="pad" />
<linearGradient
- x1="0.0434782"
+ x1="0.043478198"
y1="0.101563"
x2="0.900621"
y2="1.03125"
+ id="linearGradient231"
xlink:href="#linearGradient216"
- id="linearGradient231"
gradientUnits="objectBoundingBox"
- gradientTransform="translate(1.75173e-09,-1.08106e-08)"
spreadMethod="pad" />
<linearGradient
- x1="-0.267823"
+ x1="-0.26782301"
y1="-0.113611"
- x2="0.250212"
+ x2="0.25021201"
y2="1.2801"
+ id="linearGradient238"
xlink:href="#linearGradient310"
- id="linearGradient238"
gradientUnits="objectBoundingBox"
- gradientTransform="matrix(-1.66776,-1.248,0.0590927,-0.555388,0.492831,1.02592)"
+ gradientTransform="matrix(-1.66776,-1.248,5.90927e-2,-0.555388,0.492831,1.02592)"
spreadMethod="pad" />
<radialGradient
- cx="3.03981e-14"
+ cx="3.0398102e-14"
cy="1.05578e-10"
- r="0.773346"
- fx="3.03981e-14"
+ r="0.77334601"
+ fx="3.0398102e-14"
fy="1.05578e-10"
+ id="radialGradient280"
xlink:href="#linearGradient232"
- id="radialGradient280"
gradientUnits="objectBoundingBox"
- gradientTransform="matrix(0.945877,-9.10109e-07,-9.55425e-11,1.05722,0.264368,0.249996)"
+ gradientTransform="matrix(0.945877,-9.10109e-7,0,1.05722,0.264368,0.249996)"
spreadMethod="pad" />
<linearGradient
x1="-0.000235766"
- y1="0.492188"
+ y1="0.49218801"
x2="1.28544"
- y2="0.492188"
+ y2="0.49218801"
+ id="linearGradient290"
xlink:href="#linearGradient216"
- id="linearGradient290"
gradientUnits="objectBoundingBox"
- gradientTransform="translate(0.000274928,-9.34616e-09)"
+ gradientTransform="translate(2.74928e-4,0)"
spreadMethod="pad" />
<linearGradient
+ x1="3.2426901"
+ y1="0.60926002"
+ x2="3.0476601"
+ y2="0.82825398"
+ id="linearGradient305"
xlink:href="#linearGradient320"
- id="linearGradient305"
- x1="3.24269"
- y1="0.60926"
- x2="3.04766"
- y2="0.828254"
gradientUnits="objectBoundingBox"
- gradientTransform="matrix(1,2.88381e-09,-9.73077e-09,1,-2.65767,-0.201237)"
+ gradientTransform="translate(-2.65767,-0.201237)"
spreadMethod="pad" />
<radialGradient
- xlink:href="#linearGradient408"
- id="radialGradient306"
cx="1.13941e-09"
- cy="2.74646e-09"
+ cy="2.7464599e-09"
+ r="0.30980599"
fx="1.13941e-09"
- fy="2.74646e-09"
- r="0.309806"
+ fy="2.7464599e-09"
+ id="radialGradient306"
+ xlink:href="#linearGradient408"
gradientUnits="objectBoundingBox"
gradientTransform="matrix(0.959059,0,0,1.04269,0.394554,0.45127)"
spreadMethod="pad" />
<radialGradient
- xlink:href="#linearGradient458"
- id="radialGradient317"
cx="-2.66079e-08"
- cy="6.64885e-09"
+ cy="6.6488499e-09"
+ r="0.30992299"
fx="-2.66079e-08"
- fy="6.64885e-09"
- r="0.309923"
+ fy="6.6488499e-09"
+ id="radialGradient317"
+ xlink:href="#linearGradient458"
gradientUnits="objectBoundingBox"
- gradientTransform="matrix(1.72489,1.17189,-0.0575163,0.540669,0.503699,0.486073)"
+ gradientTransform="matrix(1.72489,1.17189,-5.75163e-2,0.540669,0.503699,0.486073)"
spreadMethod="pad" />
<linearGradient
x1="-0.0287253"
y1="0.0341933"
- x2="-0.0612692"
- y2="0.311325"
+ x2="-0.061269201"
+ y2="0.31132501"
+ id="linearGradient319"
xlink:href="#linearGradient314"
- id="linearGradient319"
gradientUnits="objectBoundingBox"
- gradientTransform="matrix(1.07397,0.00217354,-0.000316583,0.931124,0.53185,0.277306)"
+ gradientTransform="matrix(1.07397,2.17354e-3,-3.16583e-4,0.931124,0.53185,0.277306)"
spreadMethod="pad" />
<linearGradient
x1="-0.258715"
y1="-0.109747"
x2="0.241703"
- y2="1.236570"
- xlink:href="#linearGradient408"
- id="linearGradient416" />
+ y2="1.23657"
+ id="linearGradient416"
+ xlink:href="#linearGradient408" />
<linearGradient
x1="0.107623"
- y1="0.133438"
+ y1="0.13343801"
x2="1.00448"
- y2="0.986385"
+ y2="0.98638499"
+ id="linearGradient418"
xlink:href="#linearGradient232"
- id="linearGradient418"
gradientUnits="objectBoundingBox"
- gradientTransform="matrix(1,-5.11905e-06,0,1,-8.06426e-09,2.67899e-08)"
+ gradientTransform="matrix(1,-5.11905e-6,0,1,0,2.67899e-8)"
spreadMethod="pad" />
+ <radialGradient
+ cx="-53.452854"
+ cy="225.88168"
+ r="202.19385"
+ fx="-53.452854"
+ fy="225.88168"
+ id="radialGradient2665"
+ xlink:href="#linearGradient291"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.0092616,0.9908233)"
+ spreadMethod="pad" />
+ <linearGradient
+ x1="-40.478325"
+ y1="341.18823"
+ x2="119.32612"
+ y2="514.5177"
+ id="linearGradient2667"
+ xlink:href="#linearGradient216"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.0699513,0.934622)"
+ spreadMethod="pad" />
+ <linearGradient
+ x1="-27.638033"
+ y1="348.34726"
+ x2="137.4688"
+ y2="505.37048"
+ id="linearGradient2669"
+ xlink:href="#linearGradient232"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.0708712,0.9338191)"
+ spreadMethod="pad" />
+ <linearGradient
+ x1="52.739735"
+ y1="343.64432"
+ x2="53.019871"
+ y2="287.11353"
+ id="linearGradient2671"
+ xlink:href="#linearGradient408"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(3.2987788,0.3031425)"
+ spreadMethod="pad" />
</defs>
- <sodipodi:namedview
- id="base">
- <sodipodi:guide
- orientation="horizontal"
- position="26.447950"
- id="sodipodi:guide411" />
- </sodipodi:namedview>
- <path
- style="font-size:12;fill:url(#radialGradient88);fill-opacity:0.99;stroke:#0c5c7d;stroke-width:9.27151;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.99;"
- d="M -49.21 250.253 C -50.4531 237.758 -40.2031 227.28 -26.5727 228.549 L 281.811 293.495 C 293.021 296.711 300.174 303.367 303.271 318.626 L 303.001 556.999 L 271.496 574.417 L -20.6248 515.348 L -49.1325 483.196 L -49.21 250.253 z "
- id="path208"
- transform="matrix(0.296773,-0.0721048,0,0.349857,28.4112,-45.4513)"
- sodipodi:nodetypes="ccccccccc" />
- <path
- style="font-size:12;fill:url(#linearGradient231);fill-opacity:0.699301;stroke-width:8.96855;stroke:#1c2942;stroke-opacity:0.992157;"
- d="M -46.2318 305.669 L 141.393 358.659 L 143.013 470.95 L -47.4986 417.316 L -46.2318 305.669 z "
- id="path230"
- transform="matrix(0.269105,-0.0838627,0,0.297149,54.9543,7.17835)"
- sodipodi:nodetypes="ccccc" />
- <path
- style="font-size:12;fill:#ffffff;fill-opacity:0.992157;stroke-width:39.1707;stroke:#1c2942;stroke-opacity:0.992157;"
- d="M -54.9317 113.669 L 347.321 224.163 L 346.804 333.491 L -55.046 228.132 L -54.9317 113.669 z "
- id="path313"
- transform="matrix(-0.016227,0.0165668,-0.000179088,-0.0625738,25.0483,59.5183)"
- sodipodi:nodetypes="ccccc" />
- <path
- style="font-size:12;fill:url(#linearGradient418);fill-opacity:0.699301;stroke-width:6.63037;stroke:#0c5c7d;stroke-opacity:0.992157;"
- d="M -46.2318 305.669 L 141.393 358.659 L 143.013 470.95 L -47.4986 417.316 L -46.2318 305.669 z "
- id="path412"
- transform="matrix(0.380378,-0.105483,0,0.373757,48.6308,-81.8436)"
- sodipodi:nodetypes="ccccc" />
- <path
- style="font-size:12;fill:#1c2942;stroke:#0c5d7d;stroke-width:2.5;stroke-opacity:0.99;fill-opacity:0.992157;"
- d="M 147.259 91.7372 L 267.273 92.474 L 265.636 100.679 L 145.264 100.165 L 147.259 91.7372 z "
- id="path414"
- transform="matrix(0.367419,-0.00258761,0.0925713,0.528669,-11.381,6.77426)" />
- <path
- style="font-size:12;fill:#1c2942;fill-opacity:0.992157;stroke-width:8.96855;"
- d="M -40.0588 122.695 L 347.321 224.163 L 346.804 333.491 L -40.0941 229.996 L -40.0588 122.695 z "
- id="path415"
- transform="matrix(-0.0337107,0.0638003,-0.000372046,-0.240978,62.4693,163.387)"
- sodipodi:nodetypes="ccccc" />
- <path
- style="font-size:12;fill:url(#linearGradient210);stroke:#580400;stroke-width:2.5;stroke-opacity:0.992157;"
- d="M 147.259 91.7372 L 267.273 92.474 L 265.636 100.679 L 145.264 100.165 L 147.259 91.7372 z "
- id="path417"
- transform="matrix(0.576626,-0.00406098,0.145281,0.829691,-66.2039,-37.2798)" />
- <path
- style="font-size:12;fill:#1c2942;stroke:#0c5d7d;stroke-width:2.5;stroke-opacity:0.99;fill-opacity:0.992157;"
- d="M 147.259 91.7372 L 267.273 92.474 L 265.636 100.679 L 145.264 100.165 L 147.259 91.7372 z "
- id="path419"
- transform="matrix(0.367419,-0.00258761,0.0925713,0.528669,-11.381,16.8689)" />
- <path
- style="font-size:12;fill:#ffffff;fill-opacity:0.992157;stroke-width:39.1707;stroke:#1c2942;stroke-opacity:0.992157;"
- d="M -54.9317 113.669 L 347.321 224.163 L 346.804 333.491 L -55.046 228.132 L -54.9317 113.669 z "
- id="path420"
- transform="matrix(-0.016227,0.0165668,-0.000179088,-0.0625738,112.872,59.0136)"
- sodipodi:nodetypes="ccccc" />
-</svg>
\ No newline at end of file
+ <g
+ transform="matrix(1.1494743,0,0,1.1494743,3.4337672,-19.658227)"
+ id="g2646">
+ <path
+ d="M -49.21,250.253 C -50.4531,237.758 -40.2031,227.28 -26.5727,228.549 L 281.811,293.495 C 293.021,296.711 300.174,303.367 303.271,318.626 L 303.001,556.999 L 271.496,574.417 L -20.6248,515.348 L -49.1325,483.196 L -49.21,250.253 z"
+ transform="matrix(0.296773,-7.21048e-2,0,0.349857,28.4112,-45.4513)"
+ id="path208"
+ style="font-size:12px;fill:url(#radialGradient2665);fill-opacity:0.98999999;stroke:#0c5c7d;stroke-width:9.27151012;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.98999999" />
+ <path
+ d="M -46.2318,305.669 L 141.393,358.659 L 143.013,470.95 L -47.4986,417.316 L -46.2318,305.669 z"
+ transform="matrix(0.269105,-8.38627e-2,0,0.297149,54.9543,7.17835)"
+ id="path230"
+ style="font-size:12px;fill:url(#linearGradient2667);fill-opacity:0.69930103;stroke:#1c2942;stroke-width:8.96854973;stroke-opacity:0.99215698" />
+ <path
+ d="M -54.9317,113.669 L 347.321,224.163 L 346.804,333.491 L -55.046,228.132 L -54.9317,113.669 z"
+ transform="matrix(-1.6227e-2,1.65668e-2,-1.79088e-4,-6.25738e-2,25.0483,59.5183)"
+ id="path313"
+ style="font-size:12px;fill:#ffffff;fill-opacity:0.99215698;stroke:#1c2942;stroke-width:39.17070007;stroke-opacity:0.99215698" />
+ <path
+ d="M -46.2318,305.669 L 141.393,358.659 L 143.013,470.95 L -47.4986,417.316 L -46.2318,305.669 z"
+ transform="matrix(0.380378,-0.105483,0,0.373757,48.6308,-81.8436)"
+ id="path412"
+ style="font-size:12px;fill:url(#linearGradient2669);fill-opacity:0.69930103;stroke:#0c5c7d;stroke-width:6.63037014;stroke-opacity:0.99215698" />
+ <path
+ d="M 147.259,91.7372 L 267.273,92.474 L 265.636,100.679 L 145.264,100.165 L 147.259,91.7372 z"
+ transform="matrix(0.367419,-2.58761e-3,9.25713e-2,0.528669,-11.381,6.77426)"
+ id="path414"
+ style="font-size:12px;fill:#1c2942;fill-opacity:0.99215698;stroke:#0c5d7d;stroke-width:2.5;stroke-opacity:0.98999999" />
+ <path
+ d="M -40.0588,122.695 L 347.321,224.163 L 346.804,333.491 L -40.0941,229.996 L -40.0588,122.695 z"
+ transform="matrix(-3.37107e-2,6.38003e-2,-3.72046e-4,-0.240978,62.4693,163.387)"
+ id="path415"
+ style="font-size:12px;fill:#1c2942;fill-opacity:0.99215698;stroke-width:8.96854973" />
+ <path
+ d="M 147.259,91.7372 L 267.273,92.474 L 265.636,100.679 L 145.264,100.165 L 147.259,91.7372 z"
+ transform="matrix(0.576626,-4.06098e-3,0.145281,0.829691,-66.2039,-37.2798)"
+ id="path417"
+ style="font-size:12px;fill:url(#linearGradient2671);stroke:#580400;stroke-width:2.5;stroke-opacity:0.99215698" />
+ <path
+ d="M 147.259,91.7372 L 267.273,92.474 L 265.636,100.679 L 145.264,100.165 L 147.259,91.7372 z"
+ transform="matrix(0.367419,-2.58761e-3,9.25713e-2,0.528669,-11.381,16.8689)"
+ id="path419"
+ style="font-size:12px;fill:#1c2942;fill-opacity:0.99215698;stroke:#0c5d7d;stroke-width:2.5;stroke-opacity:0.98999999" />
+ <path
+ d="M -54.9317,113.669 L 347.321,224.163 L 346.804,333.491 L -55.046,228.132 L -54.9317,113.669 z"
+ transform="matrix(-1.6227e-2,1.65668e-2,-1.79088e-4,-6.25738e-2,112.872,59.0136)"
+ id="path420"
+ style="font-size:12px;fill:#ffffff;fill-opacity:0.99215698;stroke:#1c2942;stroke-width:39.17070007;stroke-opacity:0.99215698" />
+ </g>
+</svg>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-03-18 18:46:23
|
Revision: 5004
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5004&view=rev
Author: mdboom
Date: 2008-03-18 11:46:07 -0700 (Tue, 18 Mar 2008)
Log Message:
-----------
Fixing merge error. (Thanks Manuel Metz)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-03-18 18:35:10 UTC (rev 5003)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-03-18 18:46:07 UTC (rev 5004)
@@ -4188,7 +4188,6 @@
Finally, marker can be (verts, 0), verts is a sequence of (x,y)
vertices for a custom scatter symbol.
-<<<<<<< .working
numsides is the number of sides
@@ -4202,9 +4201,6 @@
Finally, marker can be (verts, 0), verts is a sequence of (x,y)
vertices for a custom scatter symbol.
-=======
-
->>>>>>> .merge-right.r4987
s is a size argument in points squared.
Any or all of x, y, s, and c may be masked arrays, in which
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-03-18 18:35:20
|
Revision: 5003
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5003&view=rev
Author: mdboom
Date: 2008-03-18 11:35:10 -0700 (Tue, 18 Mar 2008)
Log Message:
-----------
Fixing set_alpha bug when there is no facecolors (thanks Michael Fitzgerald)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/collections.py
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2008-03-14 12:22:28 UTC (rev 5002)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2008-03-18 18:35:10 UTC (rev 5003)
@@ -153,7 +153,7 @@
if self.have_units():
paths = []
- for path in self._paths:
+ for path in self.get_paths():
vertices = path.vertices
xs, ys = vertices[:, 0], vertices[:, 1]
xs = self.convert_xunits(xs)
@@ -305,7 +305,8 @@
except TypeError: raise TypeError('alpha must be a float')
else:
artist.Artist.set_alpha(self, alpha)
- self._facecolors[:, 3] = alpha
+ if len(self._facecolors):
+ self._facecolors[:, 3] = alpha
self._edgecolors[:, 3] = alpha
def get_linewidths(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-03-14 12:22:32
|
Revision: 5002
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5002&view=rev
Author: dsdale
Date: 2008-03-14 05:22:28 -0700 (Fri, 14 Mar 2008)
Log Message:
-----------
removed an unnecessary call to FigureCanvasAgg.draw in the
qt*agg backends
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/embedding_in_wx.py
trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-03-13 16:27:17 UTC (rev 5001)
+++ trunk/matplotlib/CHANGELOG 2008-03-14 12:22:28 UTC (rev 5002)
@@ -1,3 +1,7 @@
+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/examples/embedding_in_wx.py
===================================================================
--- trunk/matplotlib/examples/embedding_in_wx.py 2008-03-13 16:27:17 UTC (rev 5001)
+++ trunk/matplotlib/examples/embedding_in_wx.py 2008-03-14 12:22:28 UTC (rev 5002)
@@ -37,8 +37,6 @@
figure resizable or not.
"""
-import matplotlib
-matplotlib.use('WX')
from matplotlib.backends.backend_wx import Toolbar, FigureCanvasWx,\
FigureManager
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-03-13 16:27:17 UTC (rev 5001)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-03-14 12:22:28 UTC (rev 5002)
@@ -130,7 +130,6 @@
if DEBUG: print "FigureCanvasQtAgg.draw", self
self.replot = True
- FigureCanvasAgg.draw(self)
self.update()
def blit(self, bbox=None):
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py 2008-03-13 16:27:17 UTC (rev 5001)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py 2008-03-14 12:22:28 UTC (rev 5002)
@@ -135,7 +135,6 @@
if DEBUG: print "FigureCanvasQtAgg.draw", self
self.replot = True
- FigureCanvasAgg.draw(self)
self.repaint( False )
def blit(self, bbox=None):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-03-13 16:27:21
|
Revision: 5001
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5001&view=rev
Author: jswhit
Date: 2008-03-13 09:27:17 -0700 (Thu, 13 Mar 2008)
Log Message:
-----------
updates suggested by Eric (see Changelog entries)
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-03-11 12:07:10 UTC (rev 5000)
+++ trunk/toolkits/basemap/Changelog 2008-03-13 16:27:17 UTC (rev 5001)
@@ -1,4 +1,11 @@
version 0.99
+ * drawparallels and drawmeridians return a dictionary containing
+ the Line2D and Text instances associated with each lat or lon.
+ * drawcoastlines, drawcountries and friends now have
+ PatchCollection return values.
+ * make sure '_nolabel_' set on coastlines, countries, states,
+ rivers, parallels and meridians so they are not included in
+ a legend.
* added drawmapscale method to create a map scale bar similar
to that available with the GMT's psbasemap.
* Now lives in mpl_toolkits.basemap. Instead
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-03-11 12:07:10 UTC (rev 5000)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-03-13 16:27:17 UTC (rev 5001)
@@ -1068,6 +1068,7 @@
(default 0).
ax - axes instance to use (default None, use default axes
instance).
+ returns PatchCollection representing map boundary.
"""
# get current axes instance (if none specified).
if ax is None and self.ax is None:
@@ -1078,6 +1079,7 @@
ax = pylab.gca()
elif ax is None and self.ax is not None:
ax = self.ax
+ limb = None
if self.projection == 'ortho':
limb = Circle((self.rmajor,self.rmajor),self.rmajor)
elif self.projection == 'geos':
@@ -1115,16 +1117,16 @@
lats = npy.array(lats1+lats2+lats3+lats4,npy.float64)
x, y = self(lons,lats)
xy = zip(x,y)
- poly = Polygon(xy,edgecolor=color,linewidth=linewidth)
- ax.add_patch(poly)
+ limb = Polygon(xy,edgecolor=color,linewidth=linewidth)
+ ax.add_patch(limb)
if fill_color is None:
- poly.set_fill(False)
+ limb.set_fill(False)
else:
- poly.set_facecolor(fill_color)
- poly.set_zorder(0)
- poly.set_clip_on(False)
+ limb.set_facecolor(fill_color)
+ limb.set_zorder(0)
+ limb.set_clip_on(False)
if zorder is not None:
- poly.set_zorder(zorder)
+ limb.set_zorder(zorder)
else: # all other projections are rectangular.
ax.axesPatch.set_linewidth(linewidth)
if self.projection not in ['geos','ortho']:
@@ -1159,6 +1161,7 @@
limb.set_clip_on(True)
# set axes limits to fit map region.
self.set_axes_limits(ax=ax)
+ return limb
def fillcontinents(self,color='0.8',lake_color=None,ax=None,zorder=None):
"""
@@ -1172,6 +1175,8 @@
over the filled continents).
After filling continents, lakes are re-filled with axis background color.
+
+ returns Polygon object.
"""
if self.resolution is None:
raise AttributeError, 'there are no boundary datasets associated with this Basemap instance'
@@ -1219,6 +1224,7 @@
np = np + 1
# set axes limits to fit map region.
self.set_axes_limits(ax=ax)
+ return poly
def drawcoastlines(self,linewidth=1.,color='k',antialiased=1,ax=None,zorder=None):
"""
@@ -1230,6 +1236,7 @@
ax - axes instance (overrides default axes instance)
zorder - sets the zorder for the coastlines (if not specified,
uses default zorder for LineCollections).
+ returns a LineCollection.
"""
if self.resolution is None:
raise AttributeError, 'there are no boundary datasets associated with this Basemap instance'
@@ -1245,11 +1252,13 @@
coastlines = LineCollection(self.coastsegs,antialiaseds=(antialiased,))
coastlines.set_color(color)
coastlines.set_linewidth(linewidth)
+ coastlines.set_label('_nolabel_')
if zorder is not None:
coastlines.set_zorder(zorder)
ax.add_collection(coastlines)
# set axes limits to fit map region.
self.set_axes_limits(ax=ax)
+ return coastlines
def drawcountries(self,linewidth=0.5,color='k',antialiased=1,ax=None,zorder=None):
"""
@@ -1261,6 +1270,7 @@
ax - axes instance (overrides default axes instance)
zorder - sets the zorder for the country boundaries (if not specified,
uses default zorder for LineCollections).
+ returns a LineCollection.
"""
if self.resolution is None:
raise AttributeError, 'there are no boundary datasets associated with this Basemap instance'
@@ -1277,14 +1287,16 @@
ax = pylab.gca()
elif ax is None and self.ax is not None:
ax = self.ax
- coastlines = LineCollection(self.cntrysegs,antialiaseds=(antialiased,))
- coastlines.set_color(color)
- coastlines.set_linewidth(linewidth)
+ countries = LineCollection(self.cntrysegs,antialiaseds=(antialiased,))
+ countries.set_color(color)
+ countries.set_linewidth(linewidth)
+ countries.set_label('_nolabel_')
if zorder is not None:
- coastlines.set_zorder(zorder)
- ax.add_collection(coastlines)
+ countries.set_zorder(zorder)
+ ax.add_collection(countries)
# set axes limits to fit map region.
self.set_axes_limits(ax=ax)
+ return countries
def drawstates(self,linewidth=0.5,color='k',antialiased=1,ax=None,zorder=None):
"""
@@ -1296,6 +1308,7 @@
ax - axes instance (overrides default axes instance)
zorder - sets the zorder for the state boundaries (if not specified,
uses default zorder for LineCollections).
+ returns a LineCollection.
"""
if self.resolution is None:
raise AttributeError, 'there are no boundary datasets associated with this Basemap instance'
@@ -1312,14 +1325,16 @@
ax = pylab.gca()
elif ax is None and self.ax is not None:
ax = self.ax
- coastlines = LineCollection(self.statesegs,antialiaseds=(antialiased,))
- coastlines.set_color(color)
- coastlines.set_linewidth(linewidth)
+ states = LineCollection(self.statesegs,antialiaseds=(antialiased,))
+ states.set_color(color)
+ states.set_linewidth(linewidth)
+ states.set_label('_nolabel_')
if zorder is not None:
- coastlines.set_zorder(zorder)
- ax.add_collection(coastlines)
+ states.set_zorder(zorder)
+ ax.add_collection(states)
# set axes limits to fit map region.
self.set_axes_limits(ax=ax)
+ return states
def drawrivers(self,linewidth=0.5,color='k',antialiased=1,ax=None,zorder=None):
"""
@@ -1331,6 +1346,7 @@
ax - axes instance (overrides default axes instance)
zorder - sets the zorder for the rivers (if not specified,
uses default zorder for LineCollections).
+ returns a LineCollection
"""
if self.resolution is None:
raise AttributeError, 'there are no boundary datasets associated with this Basemap instance'
@@ -1347,14 +1363,16 @@
ax = pylab.gca()
elif ax is None and self.ax is not None:
ax = self.ax
- coastlines = LineCollection(self.riversegs,antialiaseds=(antialiased,))
- coastlines.set_color(color)
- coastlines.set_linewidth(linewidth)
+ rivers = LineCollection(self.riversegs,antialiaseds=(antialiased,))
+ rivers.set_color(color)
+ rivers.set_linewidth(linewidth)
+ rivers.set_label('_nolabel_')
if zorder is not None:
- coastlines.set_zorder(zorder)
- ax.add_collection(coastlines)
+ rivers.set_zorder(zorder)
+ ax.add_collection(rivers)
# set axes limits to fit map region.
self.set_axes_limits(ax=ax)
+ return rivers
def readshapefile(self,shapefile,name,drawbounds=True,zorder=None,
linewidth=0.5,color='k',antialiased=1,ax=None):
@@ -1474,6 +1492,7 @@
lines = LineCollection(shpsegs,antialiaseds=(1,))
lines.set_color(color)
lines.set_linewidth(linewidth)
+ lines.set_label('_nolabel_')
if zorder is not None:
lines.set_zorder(zorder)
ax.add_collection(lines)
@@ -1517,6 +1536,10 @@
additional keyword arguments control text properties for labels (see
pylab.text documentation)
+
+ returns a dictionary whose keys are the parallels, and
+ whose values are tuples containing lists of the Line2D and Text instances
+ associated with each parallel.
"""
# get current axes instance (if none specified).
if ax is None and self.ax is None:
@@ -1559,6 +1582,7 @@
circlesl.append(-latmax)
xdelta = 0.01*(self.xmax-self.xmin)
ydelta = 0.01*(self.ymax-self.ymin)
+ linecolls = {}
for circ in circlesl:
lats = circ*npy.ones(len(lons),npy.float32)
x,y = self(lons,lats)
@@ -1569,6 +1593,7 @@
testy = npy.logical_and(y>=self.ymin-ydelta,y<=self.ymax+ydelta)
x = npy.compress(testy, x)
y = npy.compress(testy, y)
+ lines = []
if len(x) > 1 and len(y) > 1:
# split into separate line segments if necessary.
# (not necessary for mercator or cylindrical or miller).
@@ -1596,9 +1621,12 @@
l = Line2D(x,y,linewidth=linewidth)
l.set_color(color)
l.set_dashes(dashes)
+ l.set_label('_nolabel_')
if zorder is not None:
l.set_zorder(zorder)
ax.add_line(l)
+ lines.append(l)
+ linecolls[circ] = (lines,[])
# draw labels for parallels
# parallels not labelled for fulldisk orthographic or geostationary
if self.projection in ['ortho','geos'] and max(labels):
@@ -1688,27 +1716,33 @@
# don't bother if close to the first label.
if i and abs(nr-nl) < 100: continue
if n >= 0:
+ t = None
if side == 'l':
if self.projection in ['moll','robin','sinu']:
xlab,ylab = self(lon_0-179.9,lat)
else:
xlab = self.llcrnrx
xlab = xlab-xoffset
- ax.text(xlab,yy[n],latlab,horizontalalignment='right',verticalalignment='center',**kwargs)
+ t = ax.text(xlab,yy[n],latlab,horizontalalignment='right',verticalalignment='center',**kwargs)
elif side == 'r':
if self.projection in ['moll','robin','sinu']:
xlab,ylab = self(lon_0+179.9,lat)
else:
xlab = self.urcrnrx
xlab = xlab+xoffset
- ax.text(xlab,yy[n],latlab,horizontalalignment='left',verticalalignment='center',**kwargs)
+ t = ax.text(xlab,yy[n],latlab,horizontalalignment='left',verticalalignment='center',**kwargs)
elif side == 'b':
- ax.text(xx[n],self.llcrnry-yoffset,latlab,horizontalalignment='center',verticalalignment='top',**kwargs)
+ t = ax.text(xx[n],self.llcrnry-yoffset,latlab,horizontalalignment='center',verticalalignment='top',**kwargs)
else:
- ax.text(xx[n],self.urcrnry+yoffset,latlab,horizontalalignment='center',verticalalignment='bottom',**kwargs)
+ t = ax.text(xx[n],self.urcrnry+yoffset,latlab,horizontalalignment='center',verticalalignment='bottom',**kwargs)
+ if t is not None: linecolls[lat][1].append(t)
# set axes limits to fit map region.
self.set_axes_limits(ax=ax)
+ keys = linecolls.keys(); vals = linecolls.values()
+ for k,v in zip(keys,vals):
+ if v == ([], []): del linecolls[k]
+ return linecolls
def drawmeridians(self,meridians,color='k',linewidth=1., zorder=None,\
dashes=[1,1],labels=[0,0,0,0],labelstyle=None,\
@@ -1741,6 +1775,10 @@
additional keyword arguments control text properties for labels (see
pylab.text documentation)
+
+ returns a dictionary whose keys are the meridians, and
+ whose values are tuples containing lists of the Line2D and Text instances
+ associated with each meridian.
"""
# get current axes instance (if none specified).
if ax is None and self.ax is None:
@@ -1769,6 +1807,7 @@
lats = npy.arange(-90,90.01,0.01)
xdelta = 0.01*(self.xmax-self.xmin)
ydelta = 0.01*(self.ymax-self.ymin)
+ linecolls = {}
for merid in meridians:
lons = merid*npy.ones(len(lats),npy.float32)
x,y = self(lons,lats)
@@ -1779,6 +1818,7 @@
testy = npy.logical_and(y>=self.ymin-ydelta,y<=self.ymax+ydelta)
x = npy.compress(testy, x)
y = npy.compress(testy, y)
+ lines = []
if len(x) > 1 and len(y) > 1:
# split into separate line segments if necessary.
# (not necessary for mercator or cylindrical or miller).
@@ -1806,9 +1846,12 @@
l = Line2D(x,y,linewidth=linewidth)
l.set_color(color)
l.set_dashes(dashes)
+ l.set_label('_nolabel_')
if zorder is not None:
l.set_zorder(zorder)
ax.add_line(l)
+ lines.append(l)
+ linecolls[merid] = (lines,[])
# draw labels for meridians.
# meridians not labelled for sinusoidal, mollweide, or
# or full-disk orthographic/geostationary.
@@ -1906,19 +1949,26 @@
# don't bother if close to the first label.
if i and abs(nr-nl) < 100: continue
if n >= 0:
+ t = None
if side == 'l':
- ax.text(self.llcrnrx-xoffset,yy[n],lonlab,horizontalalignment='right',verticalalignment='center',**kwargs)
+ t = ax.text(self.llcrnrx-xoffset,yy[n],lonlab,horizontalalignment='right',verticalalignment='center',**kwargs)
elif side == 'r':
- ax.text(self.urcrnrx+xoffset,yy[n],lonlab,horizontalalignment='left',verticalalignment='center',**kwargs)
+ t = ax.text(self.urcrnrx+xoffset,yy[n],lonlab,horizontalalignment='left',verticalalignment='center',**kwargs)
elif side == 'b':
if self.projection != 'robin' or (xx[n] > xmin and xx[n] < xmax):
- ax.text(xx[n],self.llcrnry-yoffset,lonlab,horizontalalignment='center',verticalalignment='top',**kwargs)
+ t = ax.text(xx[n],self.llcrnry-yoffset,lonlab,horizontalalignment='center',verticalalignment='top',**kwargs)
else:
if self.projection != 'robin' or (xx[n] > xmin and xx[n] < xmax):
- ax.text(xx[n],self.urcrnry+yoffset,lonlab,horizontalalignment='center',verticalalignment='bottom',**kwargs)
+ t = ax.text(xx[n],self.urcrnry+yoffset,lonlab,horizontalalignment='center',verticalalignment='bottom',**kwargs)
+ if t is not None: linecolls[lon][1].append(t)
# set axes limits to fit map region.
self.set_axes_limits(ax=ax)
+ # remove empty values from linecolls dictionary
+ keys = linecolls.keys(); vals = linecolls.values()
+ for k,v in zip(keys,vals):
+ if v == ([], []): del linecolls[k]
+ return linecolls
def gcpoints(self,lon1,lat1,lon2,lat2,npoints):
"""
@@ -1948,6 +1998,8 @@
Note: cannot handle situations in which the great circle intersects
the edge of the map projection domain, and then re-enters the domain.
+
+ Returns a Line2D object.
"""
# use great circle formula for a perfect sphere.
gc = pyproj.Geod(a=self.rmajor,b=self.rminor)
@@ -1960,7 +2012,7 @@
lats.append(lat)
lons.append(lon2); lats.append(lat2)
x, y = self(lons, lats)
- self.plot(x,y,**kwargs)
+ return self.plot(x,y,**kwargs)
def transform_scalar(self,datin,lons,lats,nx,ny,returnxy=False,checkbounds=False,order=1,masked=False):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-03-11 12:07:16
|
Revision: 5000
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5000&view=rev
Author: mdboom
Date: 2008-03-11 05:07:10 -0700 (Tue, 11 Mar 2008)
Log Message:
-----------
Fixing Arrow patch (as submitted by Michael Fitzgerald)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-03-10 15:18:49 UTC (rev 4999)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-03-11 12:07:10 UTC (rev 5000)
@@ -608,7 +608,7 @@
return self._patch_transform
# COVERAGE NOTE: Not used internally or from examples
-class Arrow(Polygon):
+class Arrow(Patch):
"""
An arrow patch
"""
@@ -628,13 +628,14 @@
Valid kwargs are:
%(Patch)s
"""
+ Patch.__init__(self, **kwargs)
L = npy.sqrt(dx**2+dy**2) or 1 # account for div by zero
cx = float(dx)/L
sx = float(dy)/L
trans1 = transforms.Affine2D().scale(L, width)
trans2 = transforms.Affine2D.from_values(cx, sx, -sx, cx, 0.0, 0.0)
- trans3 = transforms.Affine2d().translate(x, y)
+ trans3 = transforms.Affine2D().translate(x, y)
trans = trans1 + trans2 + trans3
self._patch_transform = trans.frozen()
__init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-03-10 15:19:02
|
Revision: 4999
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4999&view=rev
Author: mdboom
Date: 2008-03-10 08:18:49 -0700 (Mon, 10 Mar 2008)
Log Message:
-----------
Merged revisions 4989-4998 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4991 | mdboom | 2008-02-29 09:04:48 -0500 (Fri, 29 Feb 2008) | 2 lines
Fix classic Wx toolbar pan and zoom functions (Thanks Jeff Peery)
........
r4997 | mdboom | 2008-03-10 11:05:30 -0400 (Mon, 10 Mar 2008) | 1 line
Fix bug where Wx figures were getting shortened by the height of the status bar (Thanks, Gary Ruben)
........
r4998 | mdboom | 2008-03-10 11:06:25 -0400 (Mon, 10 Mar 2008) | 4 lines
Correcting range of subfigure values. This is a backport of 4913 from
the trunk: "fixed a bug where annotations w/ arrows were not getting
the figure instance set properly"
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4988
+ /branches/v0_91_maint:1-4998
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-03-10 15:06:25 UTC (rev 4998)
+++ trunk/matplotlib/CHANGELOG 2008-03-10 15:18:49 UTC (rev 4999)
@@ -2,6 +2,9 @@
buffer width/bbox width mismatch in _backend_agg's
copy_from_bbox - DSD
+2008-02-29 Fix class Wx toolbar pan and zoom functions (Thanks Jeff
+ Peery) - MGD
+
2008-02-16 Added some new rec array functionality to mlab
(rec_summarize, rec2txt and rec_groupby). See
examples/rec_groupby_demo.py. Thanks to Tim M for rec2txt.
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-03-10 15:06:25 UTC (rev 4998)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-03-10 15:18:49 UTC (rev 4999)
@@ -938,7 +938,7 @@
def print_bmp(self, filename, *args, **kwargs):
return self._print_image(filename, wx.BITMAP_TYPE_BMP, *args, **kwargs)
-
+
def print_jpeg(self, filename, *args, **kwargs):
return self._print_image(filename, wx.BITMAP_TYPE_JPEG, *args, **kwargs)
print_jpg = print_jpeg
@@ -948,14 +948,14 @@
def print_png(self, filename, *args, **kwargs):
return self._print_image(filename, wx.BITMAP_TYPE_PNG, *args, **kwargs)
-
+
def print_tiff(self, filename, *args, **kwargs):
return self._print_image(filename, wx.BITMAP_TYPE_TIF, *args, **kwargs)
print_tif = print_tiff
def print_xpm(self, filename, *args, **kwargs):
return self._print_image(filename, wx.BITMAP_TYPE_XPM, *args, **kwargs)
-
+
def _print_image(self, filename, filetype, *args, **kwargs):
origBitmap = self.bitmap
@@ -994,7 +994,7 @@
def get_default_filetype(self):
return 'png'
-
+
def realize(self):
"""
This method will be called when the system is ready to draw,
@@ -1230,9 +1230,9 @@
DEBUG_MSG("__init__()", 1, self)
self.num = num
- self.canvas = self.get_canvas(fig)
statbar = StatusBarWx(self)
self.SetStatusBar(statbar)
+ self.canvas = self.get_canvas(fig)
self.sizer =wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
# By adding toolbar in sizer, we are able to put it at the bottom
@@ -1829,28 +1829,28 @@
DEBUG_MSG("panx()", 1, self)
for a in self._active:
- a.panx(direction)
+ a.xaxis.pan(direction)
self.canvas.draw()
self.canvas.Refresh(eraseBackground=False)
def pany(self, direction):
DEBUG_MSG("pany()", 1, self)
for a in self._active:
- a.pany(direction)
+ a.yaxis.pan(direction)
self.canvas.draw()
self.canvas.Refresh(eraseBackground=False)
def zoomx(self, in_out):
DEBUG_MSG("zoomx()", 1, self)
for a in self._active:
- a.zoomx(in_out)
+ a.xaxis.zoom(in_out)
self.canvas.draw()
self.canvas.Refresh(eraseBackground=False)
def zoomy(self, in_out):
DEBUG_MSG("zoomy()", 1, self)
for a in self._active:
- a.zoomy(in_out)
+ a.yaxis.zoom(in_out)
self.canvas.draw()
self.canvas.Refresh(eraseBackground=False)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-03-10 15:06:30
|
Revision: 4998
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4998&view=rev
Author: mdboom
Date: 2008-03-10 08:06:25 -0700 (Mon, 10 Mar 2008)
Log Message:
-----------
Correcting range of subfigure values. This is a backport of 4913 from
the trunk: "fixed a bug where annotations w/ arrows were not getting
the figure instance set properly"
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/rcsetup.py
Modified: branches/v0_91_maint/lib/matplotlib/rcsetup.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/rcsetup.py 2008-03-10 15:05:30 UTC (rev 4997)
+++ branches/v0_91_maint/lib/matplotlib/rcsetup.py 2008-03-10 15:06:25 UTC (rev 4998)
@@ -425,13 +425,14 @@
'figure.facecolor' : [ '0.75', validate_color], # facecolor; scalar gray
'figure.edgecolor' : [ 'w', validate_color], # edgecolor; white
- 'figure.subplot.left' : [0.125, ValidateInterval(0, 1, closedmin=False, closedmax=False)],
- 'figure.subplot.right' : [0.9, ValidateInterval(0, 1, closedmin=False, closedmax=False)],
- 'figure.subplot.bottom' : [0.1, ValidateInterval(0, 1, closedmin=False, closedmax=False)],
- 'figure.subplot.top' : [0.9, ValidateInterval(0, 1, closedmin=False, closedmax=False)],
- 'figure.subplot.wspace' : [0.2, ValidateInterval(0, 1, closedmin=False, closedmax=True)],
- 'figure.subplot.hspace' : [0.2, ValidateInterval(0, 1, closedmin=False, closedmax=True)],
+ 'figure.subplot.left' : [0.125, ValidateInterval(0, 1, closedmin=True, closedmax=True)],
+ 'figure.subplot.right' : [0.9, ValidateInterval(0, 1, closedmin=True, closedmax=True)],
+ 'figure.subplot.bottom' : [0.1, ValidateInterval(0, 1, closedmin=True, closedmax=True)],
+ 'figure.subplot.top' : [0.9, ValidateInterval(0, 1, closedmin=True, closedmax=True)],
+ 'figure.subplot.wspace' : [0.2, ValidateInterval(0, 1, closedmin=True, closedmax=False)],
+ 'figure.subplot.hspace' : [0.2, ValidateInterval(0, 1, closedmin=True, closedmax=False)],
+ 'figure.autolayout' : [False, validate_bool],
'savefig.dpi' : [100, validate_float], # DPI
'savefig.facecolor' : ['w', validate_color], # facecolor; white
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-03-10 15:05:41
|
Revision: 4997
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4997&view=rev
Author: mdboom
Date: 2008-03-10 08:05:30 -0700 (Mon, 10 Mar 2008)
Log Message:
-----------
Fix bug where Wx figures were getting shortened by the height of the status bar (Thanks, Gary Ruben)
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py 2008-03-10 13:44:28 UTC (rev 4996)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py 2008-03-10 15:05:30 UTC (rev 4997)
@@ -1291,9 +1291,9 @@
DEBUG_MSG("__init__()", 1, self)
self.num = num
- self.canvas = self.get_canvas(fig)
statbar = StatusBarWx(self)
self.SetStatusBar(statbar)
+ self.canvas = self.get_canvas(fig)
self.sizer =wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
# By adding toolbar in sizer, we are able to put it at the bottom
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-03-10 13:44:52
|
Revision: 4996
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4996&view=rev
Author: dsdale
Date: 2008-03-10 06:44:28 -0700 (Mon, 10 Mar 2008)
Log Message:
-----------
workaround a blitting bug in backend_qt4agg
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/animation_blit_qt4.py
trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-03-10 12:46:12 UTC (rev 4995)
+++ trunk/matplotlib/CHANGELOG 2008-03-10 13:44:28 UTC (rev 4996)
@@ -1,3 +1,7 @@
+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
+
2008-02-16 Added some new rec array functionality to mlab
(rec_summarize, rec2txt and rec_groupby). See
examples/rec_groupby_demo.py. Thanks to Tim M for rec2txt.
Modified: trunk/matplotlib/examples/animation_blit_qt4.py
===================================================================
--- trunk/matplotlib/examples/animation_blit_qt4.py 2008-03-10 12:46:12 UTC (rev 4995)
+++ trunk/matplotlib/examples/animation_blit_qt4.py 2008-03-10 13:44:28 UTC (rev 4996)
@@ -22,7 +22,7 @@
# destroyed first and avoids a possible exception when the user clicks
# on the window's close box.
QtCore.QObject.__init__(self, self.canvas)
-
+
self.cnt = 0
# create the initial line
@@ -34,7 +34,7 @@
def timerEvent(self, evt):
# See if the size has changed since last time round.
- current_size = self.ax.bbox.width(), self.ax.bbox.height()
+ current_size = self.ax.bbox.width, self.ax.bbox.height
if self.old_size != current_size:
self.old_size = current_size
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-03-10 12:46:12 UTC (rev 4995)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-03-10 13:44:28 UTC (rev 4996)
@@ -112,6 +112,7 @@
l, b, r, t = bbox.extents
w = int(r) - int(l)
h = int(t) - int(b)
+ t = int(b) + h
reg = self.copy_from_bbox(bbox)
stringBuffer = reg.to_string()
qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-03-10 12:46:29
|
Revision: 4995
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4995&view=rev
Author: mdboom
Date: 2008-03-10 05:46:12 -0700 (Mon, 10 Mar 2008)
Log Message:
-----------
Fixing Qt/Qt4 blit shearing problem
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-03-04 22:58:49 UTC (rev 4994)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-03-10 12:46:12 UTC (rev 4995)
@@ -109,8 +109,9 @@
# we are blitting here
else:
bbox = self.replot
- l, b, w, h = bbox.bounds
- t = b + h
+ l, b, r, t = bbox.extents
+ w = int(r) - int(l)
+ h = int(t) - int(b)
reg = self.copy_from_bbox(bbox)
stringBuffer = reg.to_string()
qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32)
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py 2008-03-04 22:58:49 UTC (rev 4994)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py 2008-03-10 12:46:12 UTC (rev 4995)
@@ -115,8 +115,9 @@
# we are blitting here
else:
bbox = self.replot
- l, b, w, h = bbox.bounds
- t = b + h
+ l, b, r, t = bbox.extents
+ w = int(r) - int(l)
+ h = int(t) - int(b)
reg = self.copy_from_bbox(bbox)
stringBuffer = reg.to_string()
qImage = qt.QImage(stringBuffer, w, h, 32, None, 0, qt.QImage.IgnoreEndian)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-03-04 22:59:28
|
Revision: 4994
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4994&view=rev
Author: jswhit
Date: 2008-03-04 14:58:49 -0800 (Tue, 04 Mar 2008)
Log Message:
-----------
update docstring for drawmapscale
Modified Paths:
--------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-03-04 22:11:10 UTC (rev 4993)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-03-04 22:58:49 UTC (rev 4994)
@@ -2796,6 +2796,8 @@
fillcolor1 and fillcolor2 are only relevant for the 'fancy' scale bar.
They are the colors of the alternating filled regions (default white
and black).
+
+ extra keyword 'ax' can be used to override the default axis instance.
"""
# get current axes instance (if none specified).
if ax is None and self.ax is None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-03-04 22:11:14
|
Revision: 4993
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4993&view=rev
Author: jswhit
Date: 2008-03-04 14:11:10 -0800 (Tue, 04 Mar 2008)
Log Message:
-----------
add a map scale.
Modified Paths:
--------------
trunk/toolkits/basemap/examples/ortho_demo.py
Modified: trunk/toolkits/basemap/examples/ortho_demo.py
===================================================================
--- trunk/toolkits/basemap/examples/ortho_demo.py 2008-03-04 21:59:45 UTC (rev 4992)
+++ trunk/toolkits/basemap/examples/ortho_demo.py 2008-03-04 22:11:10 UTC (rev 4993)
@@ -29,5 +29,11 @@
m.drawparallels(arange(-90.,120.,30.))
m.drawmeridians(arange(0.,420.,60.))
m.drawmapboundary(fill_color='aqua')
+# add a map scale.
+length = 5000
+x1,y1 = 0.2*m.xmax, 0.2*m.ymax
+lon1,lat1 = m(x1,y1,inverse=True)
+m.drawmapscale(lon1,lat1,lon_0,lat_0,length,fontsize=8,barstyle='fancy',\
+ labelstyle='fancy',units='km')
title('Orthographic Map Centered on Lon=%s, Lat=%s' % (lon_0,lat_0))
show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-03-04 21:59:47
|
Revision: 4992
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4992&view=rev
Author: jswhit
Date: 2008-03-04 13:59:45 -0800 (Tue, 04 Mar 2008)
Log Message:
-----------
added drawmapscale method.
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/README
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-02-29 14:04:48 UTC (rev 4991)
+++ trunk/toolkits/basemap/Changelog 2008-03-04 21:59:45 UTC (rev 4992)
@@ -1,4 +1,6 @@
version 0.99
+ * added drawmapscale method to create a map scale bar similar
+ to that available with the GMT's psbasemap.
* Now lives in mpl_toolkits.basemap. Instead
of 'from matplotlib.toolkits.basemap import Basemap',
use 'from mpl_toolkits.basemap import Basemap'.
Modified: trunk/toolkits/basemap/README
===================================================================
--- trunk/toolkits/basemap/README 2008-02-29 14:04:48 UTC (rev 4991)
+++ trunk/toolkits/basemap/README 2008-03-04 21:59:45 UTC (rev 4992)
@@ -114,5 +114,6 @@
Scott Sinclair
Ivan Lima
Erik Andersen
+Michael Hearne
for valuable contributions.
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-02-29 14:04:48 UTC (rev 4991)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-03-04 21:59:45 UTC (rev 4992)
@@ -2768,6 +2768,176 @@
im = self.imshow(self._bm_rgba,ax=ax)
return im
+ def drawmapscale(self,lon,lat,lon0,lat0,length,barstyle='simple',\
+ units='km',fontsize=9,yoffset=None,labelstyle='simple',\
+ fontcolor='k',fillcolor1='w',fillcolor2='k',ax=None):
+ """
+ draw a map scale at lon,lat representing distance in the map
+ projection coordinates at lon0,lat0. The length of the scale
+ is specified by the length argument, with units given by the units
+ keyword (default 'km'). Two styles of scale bar are available
+ (specified by the labelstyle keyword) - 'simple' and 'fancy', which
+ correspond roughly to the corresponding styles provided by
+ the Generic Mapping Tools software. Default is 'simple'.
+
+ The fontsize and color of the map scale annotations can be specified
+ with the fontsize (default 9) and fontcolor (default black) keywords.
+
+ labelstyle='simple' results in basic annotation (the units on top
+ of the scalebar and the distance below). This is the default.
+ If labelstyle='fancy' the map scale factor (ratio between
+ the actual distance and map projection distance at lon0,lat0) and
+ the value of lon0,lat0 are also printed on top of the scale bar.
+
+ yoffset controls how tall the scale bar is, and how far the annotations
+ are offset from the scale bar. Default is 0.02 times the height of the map
+ (0.02*(self.ymax-self.ymin)).
+
+ fillcolor1 and fillcolor2 are only relevant for the 'fancy' scale bar.
+ They are the colors of the alternating filled regions (default white
+ and black).
+ """
+ # get current axes instance (if none specified).
+ if ax is None and self.ax is None:
+ try:
+ ax = pylab.gca()
+ except:
+ import pylab
+ ax = pylab.gca()
+ elif ax is None and self.ax is not None:
+ ax = self.ax
+ # not valid for cylindrical projection
+ if self.projection == 'cyl':
+ raise ValueError("cannot draw map scale for projection='cyl'")
+ # convert length to meters
+ if units == 'km':
+ lenlab = length
+ length = length*1000
+ elif units == 'mi':
+ lenlab = length
+ length = length*1609.344
+ elif units == 'nmi':
+ lenlab = length
+ length = length*1852
+ else:
+ msg = "units must be 'km' (kilometers), "\
+ "'mi' (miles) or 'nmi' (nautical miles)"
+ raise KeyError(msg)
+ # reference point and center of scale.
+ x0,y0 = self(lon0,lat0)
+ xc,yc = self(lon,lat)
+ # make sure lon_0 between -180 and 180
+ lon_0 = ((lon0+360) % 360) - 360
+ if lat0>0:
+ if lon>0:
+ lonlatstr = u'%g\N{DEGREE SIGN}N, %g\N{DEGREE SIGN}E' % (lat0,lon_0)
+ elif lon<0:
+ lonlatstr = u'%g\N{DEGREE SIGN}N, %g\N{DEGREE SIGN}W' % (lat0,lon_0)
+ else:
+ lonlatstr = u'%g\N{DEGREE SIGN}, %g\N{DEGREE SIGN}W' % (lat0,lon_0)
+ else:
+ if lon>0:
+ lonlatstr = u'%g\N{DEGREE SIGN}S, %g\N{DEGREE SIGN}E' % (lat0,lon_0)
+ elif lon<0:
+ lonlatstr = u'%g\N{DEGREE SIGN}S, %g\N{DEGREE SIGN}W' % (lat0,lon_0)
+ else:
+ lonlatstr = u'%g\N{DEGREE SIGN}S, %g\N{DEGREE SIGN}' % (lat0,lon_0)
+ # left edge of scale
+ lon1,lat1 = self(x0-length/2,y0,inverse=True)
+ x1,y1 = self(lon1,lat1)
+ # right edge of scale
+ lon4,lat4 = self(x0+length/2,y0,inverse=True)
+ x4,y4 = self(lon4,lat4)
+ x1 = x1-x0+xc; y1 = y1-y0+yc
+ x4 = x4-x0+xc; y4 = y4-y0+yc
+ if x1 > 1.e20 or x4 > 1.e20 or y1 > 1.e20 or y4 > 1.e20:
+ raise ValueError("scale bar positioned outside projection limb")
+ # scale factor for true distance
+ gc = pyproj.Geod(a=self.rmajor,b=self.rminor)
+ az12,az21,dist = gc.inv(lon1,lat1,lon4,lat4)
+ scalefact = dist/length
+ # label to put on top of scale bar.
+ if labelstyle=='simple':
+ labelstr = units
+ elif labelstyle == 'fancy':
+ labelstr = units+" (scale factor %4.2f at %s)"%(scalefact,lonlatstr)
+ else:
+ raise KeyError("labelstyle must be 'simple' or 'fancy'")
+ # default y offset is 2 percent of map height.
+ if yoffset is None: yoffset = 0.02*(self.ymax-self.ymin)
+ # 'fancy' style
+ if barstyle == 'fancy':
+ #we need 5 sets of x coordinates (in map units)
+ #quarter scale
+ lon2,lat2 = self(x0-length/4,y0,inverse=True)
+ x2,y2 = self(lon2,lat2)
+ x2 = x2-x0+xc; y2 = y2-y0+yc
+ #three quarter scale
+ lon3,lat3 = self(x0+length/4,y0,inverse=True)
+ x3,y3 = self(lon3,lat3)
+ x3 = x3-x0+xc; y3 = y3-y0+yc
+ #plot top line
+ ytop = yc+yoffset/2
+ ybottom = yc-yoffset/2
+ ytick = ybottom - yoffset/2
+ ytext = ytick - yoffset/2
+ self.plot([x1,x4],[ytop,ytop],color=fontcolor)
+ #plot bottom line
+ self.plot([x1,x4],[ybottom,ybottom],color=fontcolor)
+ #plot left edge
+ self.plot([x1,x1],[ybottom,ytop],color=fontcolor)
+ #plot right edge
+ self.plot([x4,x4],[ybottom,ytop],color=fontcolor)
+ #make a filled black box from left edge to 1/4 way across
+ ax.fill([x1,x2,x2,x1,x1],[ytop,ytop,ybottom,ybottom,ytop],\
+ ec=fontcolor,fc=fillcolor1)
+ #make a filled white box from 1/4 way across to 1/2 way across
+ ax.fill([x2,xc,xc,x2,x2],[ytop,ytop,ybottom,ybottom,ytop],\
+ ec=fontcolor,fc=fillcolor2)
+ #make a filled white box from 1/2 way across to 3/4 way across
+ ax.fill([xc,x3,x3,xc,xc],[ytop,ytop,ybottom,ybottom,ytop],\
+ ec=fontcolor,fc=fillcolor1)
+ #make a filled white box from 3/4 way across to end
+ ax.fill([x3,x4,x4,x3,x3],[ytop,ytop,ybottom,ybottom,ytop],\
+ ec=fontcolor,fc=fillcolor2)
+ #plot 3 tick marks at left edge, center, and right edge
+ self.plot([x1,x1],[ytick,ybottom],color=fontcolor)
+ self.plot([xc,xc],[ytick,ybottom],color=fontcolor)
+ self.plot([x4,x4],[ytick,ybottom],color=fontcolor)
+ #label 3 tick marks
+ ax.text(x1,ytext,'%d' % (0),\
+ horizontalalignment='center',\
+ verticalalignment='top',\
+ fontsize=fontsize,color=fontcolor)
+ ax.text(xc,ytext,'%d' % (0.5*lenlab),\
+ horizontalalignment='center',\
+ verticalalignment='top',\
+ fontsize=fontsize,color=fontcolor)
+ ax.text(x4,ytext,'%d' % (lenlab),\
+ horizontalalignment='center',\
+ verticalalignment='top',\
+ fontsize=fontsize,color=fontcolor)
+ #put units, scale factor on top
+ ax.text(xc,ytop+yoffset/2,labelstr,\
+ horizontalalignment='center',\
+ verticalalignment='bottom',\
+ fontsize=fontsize,color=fontcolor)
+ # 'simple' style
+ elif barstyle == 'simple':
+ self.plot([x1,x4],[yc,yc],color=fontcolor)
+ self.plot([x1,x1],[yc-yoffset,yc+yoffset],color=fontcolor)
+ self.plot([x4,x4],[yc-yoffset,yc+yoffset],color=fontcolor)
+ ax.text(xc,yc-yoffset,'%d' % lenlab,\
+ verticalalignment='top',horizontalalignment='center',\
+ fontsize=fontsize,color=fontcolor)
+ #put units, scale factor on top
+ ax.text(xc,yc+yoffset,labelstr,\
+ horizontalalignment='center',\
+ verticalalignment='bottom',\
+ fontsize=fontsize,color=fontcolor)
+ else:
+ raise KeyError("barstyle must be 'simple' or 'fancy'")
+
### End of Basemap class
def _searchlist(a,x):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-29 14:04:53
|
Revision: 4991
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4991&view=rev
Author: mdboom
Date: 2008-02-29 06:04:48 -0800 (Fri, 29 Feb 2008)
Log Message:
-----------
Fix classic Wx toolbar pan and zoom functions (Thanks Jeff Peery)
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-02-29 13:13:27 UTC (rev 4990)
+++ branches/v0_91_maint/CHANGELOG 2008-02-29 14:04:48 UTC (rev 4991)
@@ -1,3 +1,6 @@
+2008-02-29 Fix class Wx toolbar pan and zoom functions (Thanks Jeff
+ Peery) - MGD
+
2008-02-16 Added some new rec array functionality to mlab
(rec_summarize, rec2txt and rec_groupby). See
examples/rec_groupby_demo.py. Thanks to Tim M for rec2txt.
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py 2008-02-29 13:13:27 UTC (rev 4990)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py 2008-02-29 14:04:48 UTC (rev 4991)
@@ -999,7 +999,7 @@
def print_bmp(self, filename, *args, **kwargs):
return self._print_image(filename, wx.BITMAP_TYPE_BMP, *args, **kwargs)
-
+
def print_jpeg(self, filename, *args, **kwargs):
return self._print_image(filename, wx.BITMAP_TYPE_JPEG, *args, **kwargs)
print_jpg = print_jpeg
@@ -1009,14 +1009,14 @@
def print_png(self, filename, *args, **kwargs):
return self._print_image(filename, wx.BITMAP_TYPE_PNG, *args, **kwargs)
-
+
def print_tiff(self, filename, *args, **kwargs):
return self._print_image(filename, wx.BITMAP_TYPE_TIF, *args, **kwargs)
print_tif = print_tiff
def print_xpm(self, filename, *args, **kwargs):
return self._print_image(filename, wx.BITMAP_TYPE_XPM, *args, **kwargs)
-
+
def _print_image(self, filename, filetype, *args, **kwargs):
origBitmap = self.bitmap
@@ -1055,7 +1055,7 @@
def get_default_filetype(self):
return 'png'
-
+
def realize(self):
"""
This method will be called when the system is ready to draw,
@@ -1890,28 +1890,28 @@
DEBUG_MSG("panx()", 1, self)
for a in self._active:
- a.panx(direction)
+ a.xaxis.pan(direction)
self.canvas.draw()
self.canvas.Refresh(eraseBackground=False)
def pany(self, direction):
DEBUG_MSG("pany()", 1, self)
for a in self._active:
- a.pany(direction)
+ a.yaxis.pan(direction)
self.canvas.draw()
self.canvas.Refresh(eraseBackground=False)
def zoomx(self, in_out):
DEBUG_MSG("zoomx()", 1, self)
for a in self._active:
- a.zoomx(in_out)
+ a.xaxis.zoom(in_out)
self.canvas.draw()
self.canvas.Refresh(eraseBackground=False)
def zoomy(self, in_out):
DEBUG_MSG("zoomy()", 1, self)
for a in self._active:
- a.zoomy(in_out)
+ a.yaxis.zoom(in_out)
self.canvas.draw()
self.canvas.Refresh(eraseBackground=False)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-29 13:13:30
|
Revision: 4990
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4990&view=rev
Author: mdboom
Date: 2008-02-29 05:13:27 -0800 (Fri, 29 Feb 2008)
Log Message:
-----------
Removing duplicate code from a faulty merge.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mlab.py
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py 2008-02-25 20:27:51 UTC (rev 4989)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-02-29 13:13:27 UTC (rev 4990)
@@ -46,7 +46,6 @@
= record array helper functions =
* rec2txt : pretty print a record array
- * rec2txt : pretty print a record array
* rec2csv : store record array in CSV file
* csv2rec : import record array from CSV file with type inspection
* rec_append_field : add a field/array to record array
@@ -2114,139 +2113,6 @@
return newrec.view(npy.recarray)
-def rec_groupby(r, groupby, stats):
- """
- r is a numpy record array
-
- groupby is a sequence of record array attribute names that
- together form the grouping key. eg ('date', 'productcode')
-
- stats is a sequence of (attr, func, outname) which will call x =
- func(attr) and assign x to the record array output with attribute
- outname.
- Eg, stats = ( ('sales', len, 'numsales'), ('sales', npy.mean, 'avgsale') )
-
- return record array has dtype names for each attribute name in in
- the the 'groupby' argument, with the associated group values, and
- for each outname name in the stats argument, with the associated
- stat summary output
- """
- # build a dictionary from groupby keys-> list of indices into r with
- # those keys
- rowd = dict()
- for i, row in enumerate(r):
- key = tuple([row[attr] for attr in groupby])
- rowd.setdefault(key, []).append(i)
-
- # sort the output by groupby keys
- keys = rowd.keys()
- keys.sort()
-
- rows = []
- for key in keys:
- row = list(key)
- # get the indices for this groupby key
- ind = rowd[key]
- thisr = r[ind]
- # call each stat function for this groupby slice
- row.extend([func(thisr[attr]) for attr, func, outname in stats])
- rows.append(row)
-
- # build the output record array with groupby and outname attributes
- attrs, funcs, outnames = zip(*stats)
- names = list(groupby)
- names.extend(outnames)
- return npy.rec.fromrecords(rows, names=names)
-
-
-
-def rec_summarize(r, summaryfuncs):
- """
- r is a numpy record array
-
- summaryfuncs is a list of (attr, func, outname) which will
- apply codefunc to the the array r[attr] and assign the output
- to a new attribute name outname. The returned record array is
- identical to r, with extra arrays for each element in summaryfuncs
- """
-
- names = list(r.dtype.names)
- arrays = [r[name] for name in names]
-
- for attr, func, outname in summaryfuncs:
- names.append(outname)
- arrays.append(npy.asarray(func(r[attr])))
-
- return npy.rec.fromarrays(arrays, names=names)
-
-def rec_join(key, r1, r2):
- """
- join record arrays r1 and r2 on key; key is a tuple of field
- names. if r1 and r2 have equal values on all the keys in the key
- tuple, then their fields will be merged into a new record array
- containing the intersection of the fields of r1 and r2
- """
-
- for name in key:
- if name not in r1.dtype.names:
- raise ValueError('r1 does not have key field %s'%name)
- if name not in r2.dtype.names:
- raise ValueError('r2 does not have key field %s'%name)
-
- def makekey(row):
- return tuple([row[name] for name in key])
-
- r1d = dict([(makekey(row),i) for i,row in enumerate(r1)])
- r2d = dict([(makekey(row),i) for i,row in enumerate(r2)])
-
- r1keys = set(r1d.keys())
- r2keys = set(r2d.keys())
-
- keys = r1keys & r2keys
-
- r1ind = npy.array([r1d[k] for k in keys])
- r2ind = npy.array([r2d[k] for k in keys])
-
- # Make sure that the output rows have the same relative order as r1
- sortind = r1ind.argsort()
-
- r1 = r1[r1ind[sortind]]
- r2 = r2[r2ind[sortind]]
-
- r2 = rec_drop_fields(r2, r1.dtype.names)
-
-
- def key_desc(name):
- 'if name is a string key, use the larger size of r1 or r2 before merging'
- dt1 = r1.dtype[name]
- if dt1.type != npy.string_:
- return (name, dt1.descr[0][1])
-
- dt2 = r1.dtype[name]
- assert dt2==dt1
- if dt1.num>dt2.num:
- return (name, dt1.descr[0][1])
- else:
- return (name, dt2.descr[0][1])
-
-
-
- keydesc = [key_desc(name) for name in key]
-
- newdtype = npy.dtype(keydesc +
- [desc for desc in r1.dtype.descr if desc[0] not in key ] +
- [desc for desc in r2.dtype.descr if desc[0] not in key ] )
-
-
- newrec = npy.empty(len(r1), dtype=newdtype)
- for field in r1.dtype.names:
- newrec[field] = r1[field]
-
- for field in r2.dtype.names:
- newrec[field] = r2[field]
-
- return newrec.view(npy.recarray)
-
def csv2rec(fname, comments='#', skiprows=0, checkrows=0, delimiter=',',
converterd=None, names=None, missing=None):
"""
@@ -2633,6 +2499,7 @@
return text
+
def rec2csv(r, fname, delimiter=',', formatd=None):
"""
Save the data from numpy record array r into a comma/space/tab
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-25 20:27:53
|
Revision: 4989
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4989&view=rev
Author: mdboom
Date: 2008-02-25 12:27:51 -0800 (Mon, 25 Feb 2008)
Log Message:
-----------
Merged revisions 4947-4950,4952-4988 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4948 | jrevans | 2008-02-08 12:56:12 -0500 (Fri, 08 Feb 2008) | 2 lines
Removed a reference to nx, replaced with numpy.
........
r4977 | jdh2358 | 2008-02-19 10:26:56 -0500 (Tue, 19 Feb 2008) | 2 lines
added rec_groupby and rec2txt
........
r4987 | mdboom | 2008-02-25 15:21:39 -0500 (Mon, 25 Feb 2008) | 2 lines
[ 1901410 ] Newbie bug report: clip_on set to False actually True
........
Modified Paths:
--------------
trunk/matplotlib/examples/units/units_sample.py
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/mlab.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4946,4951
+ /branches/v0_91_maint:1-4988
Modified: trunk/matplotlib/examples/units/units_sample.py
===================================================================
--- trunk/matplotlib/examples/units/units_sample.py 2008-02-25 20:24:33 UTC (rev 4988)
+++ trunk/matplotlib/examples/units/units_sample.py 2008-02-25 20:27:51 UTC (rev 4989)
@@ -8,9 +8,10 @@
"""
from basic_units import cm, inch
-from pylab import figure, show, nx
+from pylab import figure, show
+import numpy
-cms = cm *nx.arange(0, 10, 2)
+cms = cm *numpy.arange(0, 10, 2)
fig = figure()
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-02-25 20:24:33 UTC (rev 4988)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-02-25 20:27:51 UTC (rev 4989)
@@ -2381,7 +2381,7 @@
#if t.get_clip_on(): t.set_clip_box(self.bbox)
- if kwargs.has_key('clip_on'): t.set_clip_path(self.axesPatch)
+ if kwargs.has_key('clip_on'): t.set_clip_box(self.bbox)
return t
text.__doc__ = cbook.dedent(text.__doc__) % martist.kwdocd
@@ -4188,6 +4188,7 @@
Finally, marker can be (verts, 0), verts is a sequence of (x,y)
vertices for a custom scatter symbol.
+<<<<<<< .working
numsides is the number of sides
@@ -4201,6 +4202,9 @@
Finally, marker can be (verts, 0), verts is a sequence of (x,y)
vertices for a custom scatter symbol.
+=======
+
+>>>>>>> .merge-right.r4987
s is a size argument in points squared.
Any or all of x, y, s, and c may be masked arrays, in which
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py 2008-02-25 20:24:33 UTC (rev 4988)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-02-25 20:27:51 UTC (rev 4989)
@@ -46,6 +46,7 @@
= record array helper functions =
* rec2txt : pretty print a record array
+ * rec2txt : pretty print a record array
* rec2csv : store record array in CSV file
* csv2rec : import record array from CSV file with type inspection
* rec_append_field : add a field/array to record array
@@ -2113,6 +2114,139 @@
return newrec.view(npy.recarray)
+def rec_groupby(r, groupby, stats):
+ """
+ r is a numpy record array
+
+ groupby is a sequence of record array attribute names that
+ together form the grouping key. eg ('date', 'productcode')
+
+ stats is a sequence of (attr, func, outname) which will call x =
+ func(attr) and assign x to the record array output with attribute
+ outname.
+ Eg, stats = ( ('sales', len, 'numsales'), ('sales', npy.mean, 'avgsale') )
+
+ return record array has dtype names for each attribute name in in
+ the the 'groupby' argument, with the associated group values, and
+ for each outname name in the stats argument, with the associated
+ stat summary output
+ """
+ # build a dictionary from groupby keys-> list of indices into r with
+ # those keys
+ rowd = dict()
+ for i, row in enumerate(r):
+ key = tuple([row[attr] for attr in groupby])
+ rowd.setdefault(key, []).append(i)
+
+ # sort the output by groupby keys
+ keys = rowd.keys()
+ keys.sort()
+
+ rows = []
+ for key in keys:
+ row = list(key)
+ # get the indices for this groupby key
+ ind = rowd[key]
+ thisr = r[ind]
+ # call each stat function for this groupby slice
+ row.extend([func(thisr[attr]) for attr, func, outname in stats])
+ rows.append(row)
+
+ # build the output record array with groupby and outname attributes
+ attrs, funcs, outnames = zip(*stats)
+ names = list(groupby)
+ names.extend(outnames)
+ return npy.rec.fromrecords(rows, names=names)
+
+
+
+def rec_summarize(r, summaryfuncs):
+ """
+ r is a numpy record array
+
+ summaryfuncs is a list of (attr, func, outname) which will
+ apply codefunc to the the array r[attr] and assign the output
+ to a new attribute name outname. The returned record array is
+ identical to r, with extra arrays for each element in summaryfuncs
+ """
+
+ names = list(r.dtype.names)
+ arrays = [r[name] for name in names]
+
+ for attr, func, outname in summaryfuncs:
+ names.append(outname)
+ arrays.append(npy.asarray(func(r[attr])))
+
+ return npy.rec.fromarrays(arrays, names=names)
+
+def rec_join(key, r1, r2):
+ """
+ join record arrays r1 and r2 on key; key is a tuple of field
+ names. if r1 and r2 have equal values on all the keys in the key
+ tuple, then their fields will be merged into a new record array
+ containing the intersection of the fields of r1 and r2
+ """
+
+ for name in key:
+ if name not in r1.dtype.names:
+ raise ValueError('r1 does not have key field %s'%name)
+ if name not in r2.dtype.names:
+ raise ValueError('r2 does not have key field %s'%name)
+
+ def makekey(row):
+ return tuple([row[name] for name in key])
+
+ r1d = dict([(makekey(row),i) for i,row in enumerate(r1)])
+ r2d = dict([(makekey(row),i) for i,row in enumerate(r2)])
+
+ r1keys = set(r1d.keys())
+ r2keys = set(r2d.keys())
+
+ keys = r1keys & r2keys
+
+ r1ind = npy.array([r1d[k] for k in keys])
+ r2ind = npy.array([r2d[k] for k in keys])
+
+ # Make sure that the output rows have the same relative order as r1
+ sortind = r1ind.argsort()
+
+ r1 = r1[r1ind[sortind]]
+ r2 = r2[r2ind[sortind]]
+
+ r2 = rec_drop_fields(r2, r1.dtype.names)
+
+
+ def key_desc(name):
+ 'if name is a string key, use the larger size of r1 or r2 before merging'
+ dt1 = r1.dtype[name]
+ if dt1.type != npy.string_:
+ return (name, dt1.descr[0][1])
+
+ dt2 = r1.dtype[name]
+ assert dt2==dt1
+ if dt1.num>dt2.num:
+ return (name, dt1.descr[0][1])
+ else:
+ return (name, dt2.descr[0][1])
+
+
+
+ keydesc = [key_desc(name) for name in key]
+
+ newdtype = npy.dtype(keydesc +
+ [desc for desc in r1.dtype.descr if desc[0] not in key ] +
+ [desc for desc in r2.dtype.descr if desc[0] not in key ] )
+
+
+ newrec = npy.empty(len(r1), dtype=newdtype)
+ for field in r1.dtype.names:
+ newrec[field] = r1[field]
+
+ for field in r2.dtype.names:
+ newrec[field] = r2[field]
+
+ return newrec.view(npy.recarray)
+
def csv2rec(fname, comments='#', skiprows=0, checkrows=0, delimiter=',',
converterd=None, names=None, missing=None):
"""
@@ -2499,7 +2633,6 @@
return text
-
def rec2csv(r, fname, delimiter=',', formatd=None):
"""
Save the data from numpy record array r into a comma/space/tab
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-25 20:24:38
|
Revision: 4988
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4988&view=rev
Author: mdboom
Date: 2008-02-25 12:24:33 -0800 (Mon, 25 Feb 2008)
Log Message:
-----------
Fix memory reservation for curve to line segment conversion.
Modified Paths:
--------------
trunk/matplotlib/src/_path.cpp
Modified: trunk/matplotlib/src/_path.cpp
===================================================================
--- trunk/matplotlib/src/_path.cpp 2008-02-25 20:21:39 UTC (rev 4987)
+++ trunk/matplotlib/src/_path.cpp 2008-02-25 20:24:33 UTC (rev 4988)
@@ -1120,7 +1120,7 @@
double x, y;
unsigned code;
- polygon.reserve(path.total_vertices());
+ polygon.reserve(path.total_vertices() * 2);
while ((code = curve.vertex(&x, &y)) != agg::path_cmd_stop)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-25 20:21:44
|
Revision: 4987
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4987&view=rev
Author: mdboom
Date: 2008-02-25 12:21:39 -0800 (Mon, 25 Feb 2008)
Log Message:
-----------
[ 1901410 ] Newbie bug report: clip_on set to False actually True
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/axes.py
Modified: branches/v0_91_maint/lib/matplotlib/axes.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/axes.py 2008-02-21 19:13:46 UTC (rev 4986)
+++ branches/v0_91_maint/lib/matplotlib/axes.py 2008-02-25 20:21:39 UTC (rev 4987)
@@ -2236,7 +2236,7 @@
#if t.get_clip_on(): t.set_clip_box(self.bbox)
- if kwargs.has_key('clip_on'): t.set_clip_box(self.bbox)
+ if kwargs.get('clip_on'): t.set_clip_box(self.bbox)
return t
text.__doc__ = cbook.dedent(text.__doc__) % martist.kwdocd
@@ -4046,22 +4046,22 @@
'p' : pentagram
'h' : hexagon
'8' : octagon
-
+
The marker can also be a tuple (numsides, style, angle), which will
create a custom, regular symbol.
-
+
numsides is the number of sides
-
+
style is the style of the regular symbol:
0 : a regular polygon
1 : a star-like symbol
2 : an asterisk
-
+
angle is the angle of rotation of the symbol
-
+
Finally, marker can be (verts, 0), verts is a sequence of (x,y)
vertices for a custom scatter symbol.
-
+
s is a size argument in points squared.
Any or all of x, y, s, and c may be masked arrays, in which
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|