SF.net SVN: matplotlib:[7332] trunk/toolkits/basemap/Changelog

2009-08-03 Thread jswhit
Revision: 7332
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7332&view=rev
Author:   jswhit
Date: 2009-08-03 12:21:30 + (Mon, 03 Aug 2009)

Log Message:
---
prepare for new release

Modified Paths:
--
trunk/toolkits/basemap/Changelog

Modified: trunk/toolkits/basemap/Changelog
===
--- trunk/toolkits/basemap/Changelog2009-08-01 19:34:05 UTC (rev 7331)
+++ trunk/toolkits/basemap/Changelog2009-08-03 12:21:30 UTC (rev 7332)
@@ -1,4 +1,4 @@
-version 0.99.4 (not yet released)
+version 0.99.4 (svn revision 7332)
* ax.frame replaced with ax.spines to maintain compatibility 
  with matplotlib spines support.
* added latmax kwarg to drawparallels and drawmeridians 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7334] branches/v0_99_maint

2009-08-03 Thread jdh2358
Revision: 7334
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7334&view=rev
Author:   jdh2358
Date: 2009-08-03 16:38:25 + (Mon, 03 Aug 2009)

Log Message:
---
handled sf bugs 2831556 and 2830525; better bar error messages and backend 
driver configs

Modified Paths:
--
branches/v0_99_maint/examples/tests/backend_driver.py
branches/v0_99_maint/lib/matplotlib/axes.py

Modified: branches/v0_99_maint/examples/tests/backend_driver.py
===
--- branches/v0_99_maint/examples/tests/backend_driver.py   2009-08-03 
16:32:38 UTC (rev 7333)
+++ branches/v0_99_maint/examples/tests/backend_driver.py   2009-08-03 
16:38:25 UTC (rev 7334)
@@ -374,7 +374,7 @@
 if backend in rcsetup.interactive_bk:
 tmpfile.write('show()')
 else:
-tmpfile.write('\nsavefig("%s", dpi=150)' % outfile)
+tmpfile.write('\nsavefig(r"%s", dpi=150)' % outfile)
 
 tmpfile.close()
 start_time = time.time()
@@ -458,7 +458,7 @@
 python = ['valgrind', '--tool=memcheck', '--leak-check=yes',
   '--log-file=%(name)s', 'python']
 elif sys.platform == 'win32':
-python = [r'c:\Python24\python.exe']
+python = [sys.executable]
 else:
 python = ['python']
 

Modified: branches/v0_99_maint/lib/matplotlib/axes.py
===
--- branches/v0_99_maint/lib/matplotlib/axes.py 2009-08-03 16:32:38 UTC (rev 
7333)
+++ branches/v0_99_maint/lib/matplotlib/axes.py 2009-08-03 16:38:25 UTC (rev 
7334)
@@ -4229,20 +4229,20 @@
 
 # FIXME: convert the following to proper input validation
 # raising ValueError; don't use assert for this.
-assert len(left)==nbars, "argument 'left' must be %d or scalar" % nbars
-assert len(height)==nbars, ("argument 'height' must be %d or scalar" %
+assert len(left)==nbars, "incompatible sizes: argument 'left' must be 
length %d or scalar" % nbars
+assert len(height)==nbars, ("incompatible sizes: argument 'height' 
must be length %d or scalar" %
 nbars)
-assert len(width)==nbars, ("argument 'width' must be %d or scalar" %
+assert len(width)==nbars, ("incompatible sizes: argument 'width' must 
be length %d or scalar" %
nbars)
-assert len(bottom)==nbars, ("argument 'bottom' must be %d or scalar" %
+assert len(bottom)==nbars, ("incompatible sizes: argument 'bottom' 
must be length %d or scalar" %
 nbars)
 
 if yerr is not None and len(yerr)!=nbars:
 raise ValueError(
-"bar() argument 'yerr' must be len(%s) or scalar" % nbars)
+"incompatible sizes: bar() argument 'yerr' must be len(%s) or 
scalar" % nbars)
 if xerr is not None and len(xerr)!=nbars:
 raise ValueError(
-"bar() argument 'xerr' must be len(%s) or scalar" % nbars)
+"incompatible sizes: bar() argument 'xerr' must be len(%s) or 
scalar" % nbars)
 
 patches = []
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7335] branches/v0_99_maint/examples/pylab_examples

2009-08-03 Thread jdh2358
Revision: 7335
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7335&view=rev
Author:   jdh2358
Date: 2009-08-03 17:19:42 + (Mon, 03 Aug 2009)

Log Message:
---
added two examples from Josh Hemann

Added Paths:
---
branches/v0_99_maint/examples/pylab_examples/barchart_demo2.py
branches/v0_99_maint/examples/pylab_examples/boxplot_demo2.py

Added: branches/v0_99_maint/examples/pylab_examples/barchart_demo2.py
===
--- branches/v0_99_maint/examples/pylab_examples/barchart_demo2.py  
(rev 0)
+++ branches/v0_99_maint/examples/pylab_examples/barchart_demo2.py  
2009-08-03 17:19:42 UTC (rev 7335)
@@ -0,0 +1,107 @@
+"""
+Thanks Josh Hemann for the example
+
+This examples comes from an application in which grade school gym
+teachers wanted to be able to show parents how their child did across
+a handful of fitness tests, and importantly, relative to how other
+children did. To extract the plotting code for demo purposes, we'll
+just make up some data for little Johnny Doe...
+
+"""
+import numpy as np
+import matplotlib.pyplot as plt
+import pylab
+from matplotlib.patches import Polygon
+from matplotlib.ticker import MaxNLocator
+
+
+
+student = 'Johnny Doe'
+grade = 2
+gender = 'boy'
+cohortSize = 62 #The number of other 2nd grade boys
+
+numTests = 5
+testNames = ['Pacer Test', 'Flexed Arm\n Hang', 'Mile Run', 'Agility',
+'Push Ups']
+testMeta = ['laps', 'sec', 'min:sec', 'sec', '']
+scores = ['7', '48', '12:52', '17', '14']
+rankings = np.round(np.random.uniform(0, 1, numTests)*100, 0)
+
+fig = plt.figure(figsize=(9,7))
+ax1 = fig.add_subplot(111)
+plt.subplots_adjust(left=0.115, right=0.88)
+fig.canvas.set_window_title('Eldorado K-8 Fitness Chart')
+pos = np.arange(numTests)+0.5#Center bars on the Y-axis ticks
+rects = ax1.barh(pos, rankings, align='center', height=0.5, color='m')
+
+ax1.axis([0,100,0,5])
+pylab.yticks(pos, testNames)
+ax1.set_title('Johnny Doe')
+plt.text(50, -0.5, 'Cohort Size: ' + str(cohortSize),
+horizontalalignment='center', size='small')
+
+# Set the right-hand Y-axis ticks and labels and set X-axis tick marks at the
+# deciles
+ax2 = ax1.twinx()
+ax2.plot([100,100], [0, 5], 'white', alpha=0.1)
+ax2.xaxis.set_major_locator(MaxNLocator(11))
+xticks = pylab.setp(ax2, xticklabels=['0','10','20','30','40','50','60',
+'70',
+ '80','90','100'])
+ax2.xaxis.grid(True, linestyle='--', which='major', color='grey',
+alpha=0.25)
+#Plot a solid vertical gridline to highlight the median position
+plt.plot([50,50], [0, 5], 'grey', alpha=0.25)
+
+# Build up the score labels for the right Y-axis by first appending a carriage
+# return to each string and then tacking on the appropriate meta information
+# (i.e., 'laps' vs 'seconds'). We want the labels centered on the ticks, so if
+# there is no meta info (like for pushups) then don't add the carriage return 
to
+# the string
+
+def withnew(i, scr):
+if testMeta[i] != '' : return '%s\n'%scr
+else: return scr
+scoreLabels = [withnew(i, scr) for i,scr in enumerate(scores)]
+scoreLabels = [i+j for i,j in zip(scoreLabels, testMeta)]
+pylab.yticks(pos, scoreLabels)
+ax2.set_ylabel('Test Scores')
+#Make list of numerical suffixes corresponding to position in a list
+#   0 1 2 3 4 5 6 7 8 9
+suffixes =['th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th']
+ax2.set_xlabel('Percentile Ranking Across ' + str(grade) + suffixes[grade] \
+  + ' Grade ' + gender.title() + 's')
+
+# Lastly, write in the ranking inside each bar to aid in interpretation
+for rect in rects:
+   # Rectangle widths are already integer-valued but are floating
+   # type, so it helps to remove the trailing decimal point and 0 by
+   # converting width to int type
+   width = int(rect.get_width())
+
+   # Figure out what the last digit (width modulo 10) so we can add
+   # the appropriate numerical suffix (e.g. 1st, 2nd, 3rd, etc)
+   lastDigit = width % 10
+   # Note that 11, 12, and 13 are special cases
+   if (width == 11) or (width == 12) or (width == 13):
+   suffix = 'th'
+   else:
+   suffix = suffixes[lastDigit]
+
+   rankStr = str(width) + suffix
+   if (width < 5): # The bars aren't wide enough to print the ranking inside
+   xloc = width + 1 # Shift the text to the right side of the right edge
+   clr = 'black' # Black against white background
+   align = 'left'
+   else:
+   xloc = 0.98*width # Shift the text to the left side of the right edge
+   clr = 'white' # White on magenta
+   align = 'right'
+
+   yloc = rect.get_y()+rect.get_height()/2.0 #Center the text vertically in 
the bar
+   ax1.text(xloc, yloc, rankStr, horizontalalignment=align,
+verticalalignment='center', color=clr, weight='bold')
+
+plt.show()
+

Added: branches/v0_99_maint/examples/pylab_examples/boxp

SF.net SVN: matplotlib:[7336] branches/v0_99_maint/lib/matplotlib/mlab.py

2009-08-03 Thread jdh2358
Revision: 7336
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7336&view=rev
Author:   jdh2358
Date: 2009-08-03 17:40:17 + (Mon, 03 Aug 2009)

Log Message:
---
fixed rec2csv win32 file handle bug from sf patch 2831018

Modified Paths:
--
branches/v0_99_maint/lib/matplotlib/mlab.py

Modified: branches/v0_99_maint/lib/matplotlib/mlab.py
===
--- branches/v0_99_maint/lib/matplotlib/mlab.py 2009-08-03 17:19:42 UTC (rev 
7335)
+++ branches/v0_99_maint/lib/matplotlib/mlab.py 2009-08-03 17:40:17 UTC (rev 
7336)
@@ -2595,7 +2595,7 @@
 for i, name in enumerate(r.dtype.names):
 funcs.append(with_mask(csvformat_factory(formatd[name]).tostr))
 
-fh, opened = cbook.to_filehandle(fname, 'w', return_opened=True)
+fh, opened = cbook.to_filehandle(fname, 'wb', return_opened=True)
 writer = csv.writer(fh, delimiter=delimiter)
 header = r.dtype.names
 if withheader:


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[7337] branches/v0_99_maint

2009-08-03 Thread jdh2358
Revision: 7337
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7337&view=rev
Author:   jdh2358
Date: 2009-08-03 19:31:05 + (Mon, 03 Aug 2009)

Log Message:
---
removed a couple of cases of mlab.load

Modified Paths:
--
branches/v0_99_maint/doc/_templates/indexsidebar.html
branches/v0_99_maint/doc/api/spine_api.rst
branches/v0_99_maint/doc/pyplots/plotmap.py
branches/v0_99_maint/examples/pylab_examples/load_converter.py

Modified: branches/v0_99_maint/doc/_templates/indexsidebar.html
===
--- branches/v0_99_maint/doc/_templates/indexsidebar.html   2009-08-03 
17:40:17 UTC (rev 7336)
+++ branches/v0_99_maint/doc/_templates/indexsidebar.html   2009-08-03 
19:31:05 UTC (rev 7337)
@@ -3,17 +3,12 @@
 Please http://sourceforge.net/project/project_donations.php?group_id=80706";>donate
 to support matplotlib development.
 
-Watch a http://videolectures.net/mloss08_hunter_mat";>video 
lecture about matplotlib presented at http://videolectures.net/mloss08_whistler";>NIPS 08 Workshop 
Machine Learning Open Source Software. 
+A release candidate rc1 of matplotlib-0.99.0 is http://drop.io/xortel1#";>available for testing.  Please post any bugs 
to the http://sourceforge.net/tracker2/?group_id=80706";>tracker
 
 
-Nominate matplotlib for a community choice award by clicking the
-image below -- suggested category "Best Project for Academia" for
-software which "helps you hit the books, analyze global trends, or
-just understand the world a little bit better than you did before":
-http://sourceforge.net/community/cca09/nominate/?project_name=matplotlib&project_url=http://sourceforge.net/projects/matplotlib/";>http://sourceforge.net/images/cca/cca_nominate.png"; border="0"/>
+Watch a http://videolectures.net/mloss08_hunter_mat";>video 
lecture about matplotlib presented at http://videolectures.net/mloss08_whistler";>NIPS 08 Workshop 
Machine Learning Open Source Software. 
 
 
-
 Download
 Current version: {{ version }}
 

Modified: branches/v0_99_maint/doc/api/spine_api.rst
===
--- branches/v0_99_maint/doc/api/spine_api.rst  2009-08-03 17:40:17 UTC (rev 
7336)
+++ branches/v0_99_maint/doc/api/spine_api.rst  2009-08-03 19:31:05 UTC (rev 
7337)
@@ -4,7 +4,7 @@
 
 
 :mod:`matplotlib.spine`
-==
+
 
 .. automodule:: matplotlib.spine
:members:

Modified: branches/v0_99_maint/doc/pyplots/plotmap.py
===
--- branches/v0_99_maint/doc/pyplots/plotmap.py 2009-08-03 17:40:17 UTC (rev 
7336)
+++ branches/v0_99_maint/doc/pyplots/plotmap.py 2009-08-03 19:31:05 UTC (rev 
7337)
@@ -5,7 +5,9 @@
 # the data is interpolated to the native projection grid.
 import os
 from mpl_toolkits.basemap import Basemap, shiftgrid
-from pylab import title, colorbar, show, axes, cm, load, arange, figure, \
+import numpy as np
+
+from pylab import title, colorbar, show, axes, cm, arange, figure, \
   text
 
 # read in topo data (on a regular lat/lon grid)
@@ -15,9 +17,9 @@
 if not os.path.exists(datadir):
 raise SystemExit('You need to download the data with svn co 
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/htdocs/screenshots/data/";
 and set the datadir variable in %s'%__file__)
 
-topoin = load(os.path.join(datadir, 'etopo20data.gz'))
-lons = load(os.path.join(datadir, 'etopo20lons.gz'))
-lats = load(os.path.join(datadir, 'etopo20lats.gz'))
+topoin = np.loadtxt(os.path.join(datadir, 'etopo20data.gz'))
+lons = np.loadtxt(os.path.join(datadir, 'etopo20lons.gz'))
+lats = np.loadtxt(os.path.join(datadir, 'etopo20lats.gz'))
 # shift data so lons go from -180 to 180 instead of 20 to 380.
 topoin,lons = shiftgrid(180.,topoin,lons,start=False)
 

Modified: branches/v0_99_maint/examples/pylab_examples/load_converter.py
===
--- branches/v0_99_maint/examples/pylab_examples/load_converter.py  
2009-08-03 17:40:17 UTC (rev 7336)
+++ branches/v0_99_maint/examples/pylab_examples/load_converter.py  
2009-08-03 19:31:05 UTC (rev 7337)
@@ -1,8 +1,9 @@
 from matplotlib.dates import strpdate2num
-from matplotlib.mlab import load
+#from matplotlib.mlab import load
+import numpy as np
 from pylab import figure, show
 
-dates, closes = load(
+dates, closes = np.loadtxt(
 '../data/msft.csv', delimiter=',',
 converters={0:strpdate2num('%d-%b-%y')},
 skiprows=1, usecols=(0,2), unpack=True)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do b

SF.net SVN: matplotlib:[7340] trunk/matplotlib/lib/matplotlib/collections. py

2009-08-03 Thread efiring
Revision: 7340
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7340&view=rev
Author:   efiring
Date: 2009-08-04 06:52:24 + (Tue, 04 Aug 2009)

Log Message:
---
Add PathCollection; reorganize collections.py
PathCollection is added to support complex paths in contourf.
Other changes are to improve readability and reduce redundancy.

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/collections.py

Modified: trunk/matplotlib/lib/matplotlib/collections.py
===
--- trunk/matplotlib/lib/matplotlib/collections.py  2009-08-03 20:06:02 UTC 
(rev 7339)
+++ trunk/matplotlib/lib/matplotlib/collections.py  2009-08-04 06:52:24 UTC 
(rev 7340)
@@ -5,15 +5,15 @@
 
 The classes are not meant to be as flexible as their single element
 counterparts (e.g. you may not be able to select all line styles) but
-they are meant to be fast for common use cases (e.g. a bunch of solid
+they are meant to be fast for common use cases (e.g. a large set of solid
 line segemnts)
 """
-import copy, math, warnings
+import warnings
 import numpy as np
-from numpy import ma
+import numpy.ma as ma
 import matplotlib as mpl
 import matplotlib.cbook as cbook
-import matplotlib.colors as _colors # avoid conflict with kwarg
+import matplotlib.colors as mcolors
 import matplotlib.cm as cm
 import matplotlib.transforms as transforms
 import matplotlib.artist as artist
@@ -106,6 +106,7 @@
 
 self._pickradius = pickradius
 self.update(kwargs)
+self._paths = None
 
 
 def _get_value(self, val):
@@ -131,6 +132,9 @@
 
 
 def get_paths(self):
+return self._paths
+
+def set_paths(self):
 raise NotImplementedError
 
 def get_transforms(self):
@@ -385,7 +389,7 @@
 pass
 if c is None: c = mpl.rcParams['patch.facecolor']
 self._facecolors_original = c
-self._facecolors = _colors.colorConverter.to_rgba_array(c, self._alpha)
+self._facecolors = mcolors.colorConverter.to_rgba_array(c, self._alpha)
 
 def set_facecolors(self, c):
 """alias for set_facecolor"""
@@ -427,7 +431,7 @@
 else:
 if c is None: c = mpl.rcParams['patch.edgecolor']
 self._edgecolors_original = c
-self._edgecolors = _colors.colorConverter.to_rgba_array(c, 
self._alpha)
+self._edgecolors = mcolors.colorConverter.to_rgba_array(c, 
self._alpha)
 
 
 def set_edgecolors(self, c):
@@ -446,13 +450,13 @@
 else:
 artist.Artist.set_alpha(self, alpha)
 try:
-self._facecolors = _colors.colorConverter.to_rgba_array(
+self._facecolors = mcolors.colorConverter.to_rgba_array(
 self._facecolors_original, self._alpha)
 except (AttributeError, TypeError, IndexError):
 pass
 try:
 if self._edgecolors_original != 'face':
-self._edgecolors = _colors.colorConverter.to_rgba_array(
+self._edgecolors = mcolors.colorConverter.to_rgba_array(
 self._edgecolors_original, self._alpha)
 except (AttributeError, TypeError, IndexError):
 pass
@@ -516,133 +520,27 @@
 setting, in sequence form.
 """
 
-class QuadMesh(Collection):
+class PathCollection(Collection):
 """
-Class for the efficient drawing of a quadrilateral mesh.
-
-A quadrilateral mesh consists of a grid of vertices. The
-dimensions of this array are (*meshWidth* + 1, *meshHeight* +
-1). Each vertex in the mesh has a different set of "mesh
-coordinates" representing its position in the topology of the
-mesh. For any values (*m*, *n*) such that 0 <= *m* <= *meshWidth*
-and 0 <= *n* <= *meshHeight*, the vertices at mesh coordinates
-(*m*, *n*), (*m*, *n* + 1), (*m* + 1, *n* + 1), and (*m* + 1, *n*)
-form one of the quadrilaterals in the mesh. There are thus
-(*meshWidth* * *meshHeight*) quadrilaterals in the mesh.  The mesh
-need not be regular and the polygons need not be convex.
-
-A quadrilateral mesh is represented by a (2 x ((*meshWidth* + 1) *
-(*meshHeight* + 1))) numpy array *coordinates*, where each row is
-the *x* and *y* coordinates of one of the vertices.  To define the
-function that maps from a data point to its corresponding color,
-use the :meth:`set_cmap` method.  Each of these arrays is indexed in
-row-major order by the mesh coordinates of the vertex (or the mesh
-coordinates of the lower left vertex, in the case of the
-colors).
-
-For example, the first entry in *coordinates* is the
-coordinates of the vertex at mesh coordinates (0, 0), then the one
-at (0, 1), then at (0, 2) .. (0, meshWidth), (1, 0), (1, 1), and
-so on.
+This is the most basic :class:`Collection` subclass.
 """
-def __init__(self, meshWidth, meshHeight, coo