SF.net SVN: matplotlib: [4987] branches/v0_91_maint/lib/matplotlib/axes.py

2008-02-25 Thread mdboom
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.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4988] trunk/matplotlib/src/_path.cpp

2008-02-25 Thread mdboom
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.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4989] trunk/matplotlib

2008-02-25 Thread mdboom
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)
+name