SF.net SVN: matplotlib:[7414] branches/v0_99_maint/doc/users

2009-08-07 Thread jdh2358
Revision: 7414
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7414&view=rev
Author:   jdh2358
Date: 2009-08-07 10:15:04 + (Fri, 07 Aug 2009)

Log Message:
---
some doc fixes

Modified Paths:
--
branches/v0_99_maint/doc/users/annotations.rst
branches/v0_99_maint/doc/users/artists.rst
branches/v0_99_maint/doc/users/event_handling.rst
branches/v0_99_maint/doc/users/pyplot_tutorial.rst

Modified: branches/v0_99_maint/doc/users/annotations.rst
===
--- branches/v0_99_maint/doc/users/annotations.rst  2009-08-07 00:42:20 UTC 
(rev 7413)
+++ branches/v0_99_maint/doc/users/annotations.rst  2009-08-07 10:15:04 UTC 
(rev 7414)
@@ -78,6 +78,4 @@
 .. plot:: pyplots/annotation_polar.py
:include-source:
 
-See the `annotations demo
-`_ for 
more
-examples.
+For more on all the wild and wonderful things you can do with annotations, 
including fancy arrows, see :ref:`plotting-guide-annotation` and 
:ref:`pylab_examples-annotation_demo`.

Modified: branches/v0_99_maint/doc/users/artists.rst
===
--- branches/v0_99_maint/doc/users/artists.rst  2009-08-07 00:42:20 UTC (rev 
7413)
+++ branches/v0_99_maint/doc/users/artists.rst  2009-08-07 10:15:04 UTC (rev 
7414)
@@ -19,27 +19,7 @@
 and laying out the figure, text, and lines.  The typical user will
 spend 95% of his time working with the ``Artists``.
 
-There are two types of ``Artists``: primitives and containers.  The
-primitives represent the standard graphical objects we want to paint
-onto our canvas: :class:`~matplotlib.lines.Line2D`,
-:class:`~matplotlib.patches.Rectangle`,
-:class:`~matplotlib.text.Text`, :class:`~matplotlib.image.AxesImage`,
-etc., and the containers are places to put them
-(:class:`~matplotlib.axis.Axis`, :class:`~matplotlib.axes.Axes` and
-:class:`~matplotlib.figure.Figure`).  The standard use is to create a
-:class:`~matplotlib.figure.Figure` instance, use the ``Figure`` to
-create one or more :class:`~matplotlib.axes.Axes` or
-:class:`~matplotlib.axes.Subplot` instances, and use the ``Axes``
-instance helper methods to create the primitives.  In the example
-below, we create a ``Figure`` instance using
-:func:`matplotlib.pyplot.figure`, which is a convenience method for
-instantiating ``Figure`` instances and connecting them with your user
-interface or drawing toolkit ``FigureCanvas``.  As we will discuss
-below, this is not necessary, and you can work directly with
-PostScript, PDF Gtk+, or wxPython ``FigureCanvas`` instances.  For
-example, instantiate your ``Figures`` directly and connect them
-yourselves, but since we are focusing here on the ``Artist`` API we'll let
-:mod:`~matplotlib.pyplot` handle some of those details for us::
+There are two types of ``Artists``: primitives and containers.  The primitives 
represent the standard graphical objects we want to paint onto our canvas: 
:class:`~matplotlib.lines.Line2D`, :class:`~matplotlib.patches.Rectangle`, 
:class:`~matplotlib.text.Text`, :class:`~matplotlib.image.AxesImage`, etc., and 
the containers are places to put them (:class:`~matplotlib.axis.Axis`, 
:class:`~matplotlib.axes.Axes` and :class:`~matplotlib.figure.Figure`).  The 
standard use is to create a :class:`~matplotlib.figure.Figure` instance, use 
the ``Figure`` to create one or more :class:`~matplotlib.axes.Axes` or 
:class:`~matplotlib.axes.Subplot` instances, and use the ``Axes`` instance 
helper methods to create the primitives.  In the example below, we create a 
``Figure`` instance using :func:`matplotlib.pyplot.figure`, which is a 
convenience method for instantiating ``Figure`` instances and connecting them 
with your user interface or drawing toolkit ``FigureCanvas``.  As we will 
discuss below, this is not necessary -- you can work directly with PostScript, 
PDF Gtk+, or wxPython ``FigureCanvas`` instances, instantiate your ``Figures`` 
directly and connect them yourselves -- but since we are focusing here on the 
``Artist`` API we'll let :mod:`~matplotlib.pyplot` handle some of those details 
for us::
 
 import matplotlib.pyplot as plt
 fig = plt.figure()
@@ -85,7 +65,7 @@
 ` list.  In the interactive `ipython
 `_ session below, you can see that the
 ``Axes.lines`` list is length one and contains the same line that was
-returned by the ``line, = ax.plot(x, y, 'o')`` call:
+returned by the ``line, = ax.plot...`` call:
 
 .. sourcecode:: ipython
 
@@ -536,20 +516,7 @@
 :class:`~matplotlib.ticker.Formatter` instances which control where
 the ticks are placed and how they are represented as strings.
 
-Each ``Axis`` object contains a :attr:`~matplotlib.axis.Axis.label`
-attribute (this is what the :mod:`~matplotlib.pylab` calls to
-:func:`~matplotlib.pylab.xlabel` and :func:`~matplotlib.pylab.ylabel`
-set) as well as a list

SF.net SVN: matplotlib:[7415] trunk/toolkits/basemap/lib/mpl_toolkits/ basemap/__init__.py

2009-08-07 Thread jswhit
Revision: 7415
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7415&view=rev
Author:   jswhit
Date: 2009-08-07 14:26:35 + (Fri, 07 Aug 2009)

Log Message:
---
change example in docstrings to use np.loadtxt instead of mlab.load

Modified Paths:
--
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py

Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-08-07 
10:15:04 UTC (rev 7414)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-08-07 
14:26:35 UTC (rev 7415)
@@ -379,11 +379,10 @@
  >>> from mpl_toolkits.basemap import Basemap
  >>> import numpy as np
  >>> import matplotlib.pyplot as plt
- >>> import matplotlib.mlab as mlab
  >>> # read in topo data (on a regular lat/lon grid)
- >>> etopo = mlab.load('etopo20data.gz')
- >>> lons  = mlab.load('etopo20lons.gz')
- >>> lats  = mlab.load('etopo20lats.gz')
+ >>> etopo = np.loadtxt('etopo20data.gz')
+ >>> lons  = np.loadtxt('etopo20lons.gz')
+ >>> lats  = np.loadtxt('etopo20lats.gz')
  >>> # create Basemap instance for Robinson projection.
  >>> m = Basemap(projection='robin',lon_0=0.5*(lons[0]+lons[-1]))
  >>> # compute map projection coordinates for lat/lon grid.


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:[7416] branches/v0_99_maint

2009-08-07 Thread jdh2358
Revision: 7416
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7416&view=rev
Author:   jdh2358
Date: 2009-08-07 15:40:56 + (Fri, 07 Aug 2009)

Log Message:
---
don't fail on window icon load

Modified Paths:
--
branches/v0_99_maint/doc/devel/coding_guide.rst
branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py

Modified: branches/v0_99_maint/doc/devel/coding_guide.rst
===
--- branches/v0_99_maint/doc/devel/coding_guide.rst 2009-08-07 14:26:35 UTC 
(rev 7415)
+++ branches/v0_99_maint/doc/devel/coding_guide.rst 2009-08-07 15:40:56 UTC 
(rev 7416)
@@ -24,17 +24,11 @@
svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/\
matplotlib mpl --username=youruser --password=yourpass
 
-Branch checkouts, eg the maintenance branch::
+Branch checkouts, eg the release branch::
 
-   svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/\
-   v0_91_maint mpl91 --username=youruser --password=yourpass
+   svn co 
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_99_maint mpl99
 
-The current release of the trunk is in the 0.98.5 maintenance branch::
 
-   svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/\
-   v0_98_5_maint mpl98.5 --username=youruser --password=yourpass
-
-
 Committing changes
 --
 
@@ -64,11 +58,10 @@
   :file:`MANIFEST.in`.  This file determines what goes into the source
   distribution of the mpl build.
 
-* Keep the maintenance branch (0.91) the latest release branch (eg
-  0.98.4) and trunk in sync where it makes sense.  If there is a bug
-  on both that needs fixing, use `svnmerge.py
-  `_ to keep them in
-  sync.  See :ref:`svn-merge` below.
+* Keep the release branch (eg 0.90 and trunk in sync where it makes
+  sense.  If there is a bug on both that needs fixing, use
+  `svnmerge.py `_ to
+  keep them in sync.  See :ref:`svn-merge` below.
 
 .. _svn-merge:
 
@@ -96,7 +89,7 @@
svnmerge.py merge -S BRANCHNAME
 
   Where BRANCHNAME is the name of the branch to merge *from*,
-  e.g. v0_98_5_maint.
+  e.g. v0_99_maint.
 
   If you wish to merge only specific revisions (in an unusual
   situation), do::

Modified: branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py
===
--- branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009-08-07 
14:26:35 UTC (rev 7415)
+++ branches/v0_99_maint/lib/matplotlib/backends/backend_gtk.py 2009-08-07 
15:40:56 UTC (rev 7416)
@@ -440,8 +440,15 @@
 self.window = gtk.Window()
 self.window.set_title("Figure %d" % num)
 if (window_icon):
-self.window.set_icon_from_file(window_icon)
-
+try:
+self.window.set_icon_from_file(window_icon)
+except:
+# some versions of gtk throw a glib.GError but not
+# all, so I am not sure how to catch it.  I am unhappy
+# diong a blanket catch here, but an not sure what a
+# better way is - JDH
+verbose.report('Could not load matplotlib icon: %s' % 
sys.exc_info()[1])
+
 self.vbox = gtk.VBox()
 self.window.add(self.vbox)
 self.vbox.show()
@@ -666,7 +673,11 @@
 
 window = gtk.Window()
 if (window_icon):
-window.set_icon_from_file(window_icon)
+try: window.set_icon_from_file(window_icon)
+except:
+# we presumably already logged a message on the
+# failure of the main plot, don't keep reporting
+pass
 window.set_title("Subplot Configuration Tool")
 window.set_default_size(w, h)
 vbox = gtk.VBox()


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:[7417] trunk/matplotlib

2009-08-07 Thread mdboom
Revision: 7417
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7417&view=rev
Author:   mdboom
Date: 2009-08-07 17:02:28 + (Fri, 07 Aug 2009)

Log Message:
---
Refactor some backend methods for consistency and to reduce explosion of the 
number of arguments.  A first crack at Gouraud shading in the Agg backend (not 
hooked up to anything).

Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/doc/api/api_changes.rst
trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py
trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py
trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py
trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
trunk/matplotlib/lib/matplotlib/backends/backend_template.py
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
trunk/matplotlib/lib/matplotlib/collections.py
trunk/matplotlib/lib/matplotlib/figure.py
trunk/matplotlib/lib/matplotlib/font_manager.py
trunk/matplotlib/lib/matplotlib/image.py
trunk/matplotlib/src/_backend_agg.cpp
trunk/matplotlib/src/_backend_agg.h

Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG  2009-08-07 15:40:56 UTC (rev 7416)
+++ trunk/matplotlib/CHANGELOG  2009-08-07 17:02:28 UTC (rev 7417)
@@ -1,3 +1,41 @@
+2009-08-07 In an effort to simplify the backend API, all clipping rectangles
+   and paths are now passed in using GraphicsContext objects, even
+   on collections and images.  Therefore:
+
+ draw_path_collection(self, master_transform, cliprect, clippath,
+  clippath_trans, paths, all_transforms, 
offsets,
+  offsetTrans, facecolors, edgecolors, 
linewidths,
+  linestyles, antialiaseds, urls)
+
+ becomes:
+
+ draw_path_collection(self, gc, master_transform, paths, 
all_transforms,
+  offsets, offsetTrans, facecolors, edgecolors,
+  linewidths, linestyles, antialiaseds, urls)
+
+
+
+ draw_quad_mesh(self, master_transform, cliprect, clippath,
+clippath_trans, meshWidth, meshHeight, coordinates,
+offsets, offsetTrans, facecolors, antialiased,
+showedges)
+
+ becomes:
+
+ draw_quad_mesh(self, gc, master_transform, meshWidth, meshHeight,
+coordinates, offsets, offsetTrans, facecolors,
+antialiased, showedges)
+
+
+
+ draw_image(self, x, y, im, bbox, clippath=None, 
clippath_trans=None)
+
+ becomes:
+
+ draw_image(self, gc, x, y, im)
+
+   - MGD
+
 2009-08-06 Tagging the 0.99.0 release at svn r7397 - JDH
 
   * fixed an alpha colormapping bug posted on sf 2832575
@@ -30,7 +68,6 @@
 
   * apply sf patches 2830233 and 2823885 for osx setup and 64 bit;  
thanks Michiel
 
-
 2009-08-04 Made cbook.get_sample_data make use of the ETag and Last-Modified
headers of mod_dav_svn. - JKS
 

Modified: trunk/matplotlib/doc/api/api_changes.rst
===
--- trunk/matplotlib/doc/api/api_changes.rst2009-08-07 15:40:56 UTC (rev 
7416)
+++ trunk/matplotlib/doc/api/api_changes.rst2009-08-07 17:02:28 UTC (rev 
7417)
@@ -18,6 +18,43 @@
 .. _configobj: http://www.voidspace.org.uk/python/configobj.html
 .. _`enthought.traits`: http://code.enthought.com/projects/traits
 
+Changes beyond 0.99.x
+=
+
+In an effort to simplify the backend API, all clipping rectangles
+and paths are now passed in using GraphicsContext objects, even
+on collections and images.  Therefore::
+
+  draw_path_collection(self, master_transform, cliprect, clippath,
+   clippath_trans, paths, all_transforms, offsets,
+   offsetTrans, facecolors, edgecolors, linewidths,
+   linestyles, antialiaseds, urls)
+
+  # is now
+
+  draw_path_collection(self, gc, master_transform, paths, all_transforms,
+   offsets, offsetTrans, facecolors, edgecolors,
+   linewidths, linestyles, antialiaseds, urls)
+
+
+  draw_quad_mesh(self, master_transform, cliprect, clippath,
+ clippath_trans, 

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

2009-08-07 Thread mdboom
Revision: 7418
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7418&view=rev
Author:   mdboom
Date: 2009-08-07 18:31:45 + (Fri, 07 Aug 2009)

Log Message:
---
Experimental Gouraud shading support in the Agg backend.

Modified Paths:
--
trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
trunk/matplotlib/lib/matplotlib/collections.py
trunk/matplotlib/src/_backend_agg.cpp

Modified: trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py
===
--- trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py   2009-08-07 
17:02:28 UTC (rev 7417)
+++ trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py   2009-08-07 
18:31:45 UTC (rev 7418)
@@ -28,7 +28,7 @@
 fig = figure()
 ax = fig.add_subplot(121)
 ax.set_axis_bgcolor("#bdb76b")
-ax.pcolormesh(Qx,Qz,Z)
+ax.pcolormesh(Qx,Qz,Z, shading='gouraud')
 ax.set_title('Without masked values')
 
 ax = fig.add_subplot(122)

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-08-07 17:02:28 UTC (rev 
7417)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-08-07 18:31:45 UTC (rev 
7418)
@@ -6543,7 +6543,7 @@
 and max of the color array *C* is used.  If you pass a
 *norm* instance, *vmin* and *vmax* will be ignored.
 
-  *shading*: [ 'flat' | 'faceted' ]
+  *shading*: [ 'flat' | 'faceted' | 'gouraud' ]
 If 'faceted', a black grid is drawn around each rectangle; if
 'flat', edges are not drawn. Default is 'flat', contrary to
 Matlab(TM).
@@ -6584,7 +6584,7 @@
 cmap = kwargs.pop('cmap', None)
 vmin = kwargs.pop('vmin', None)
 vmax = kwargs.pop('vmax', None)
-shading = kwargs.pop('shading', 'flat')
+shading = kwargs.pop('shading', 'flat').lower()
 edgecolors = kwargs.pop('edgecolors', 'None')
 antialiased = kwargs.pop('antialiased', False)
 
@@ -6592,8 +6592,11 @@
 Ny, Nx = X.shape
 
 # convert to one dimensional arrays
-C = ma.ravel(C[0:Ny-1, 0:Nx-1]) # data point in each cell is value at
-# lower left corner
+if shading != 'gouraud':
+C = ma.ravel(C[0:Ny-1, 0:Nx-1]) # data point in each cell is value 
at
+# lower left corner
+else:
+C = C.ravel()
 X = X.ravel()
 Y = Y.ravel()
 
@@ -6608,7 +6611,7 @@
 
 collection = mcoll.QuadMesh(
 Nx - 1, Ny - 1, coords, showedges,
-antialiased=antialiased)  # kwargs are not used
+antialiased=antialiased, shading=shading)  # kwargs are not used
 collection.set_alpha(alpha)
 collection.set_array(C)
 if norm is not None: assert(isinstance(norm, mcolors.Normalize))

Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===
--- trunk/matplotlib/lib/matplotlib/backend_bases.py2009-08-07 17:02:28 UTC 
(rev 7417)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py2009-08-07 18:31:45 UTC 
(rev 7418)
@@ -166,6 +166,14 @@
 gc, master_transform, paths, [], offsets, offsetTrans, facecolors,
 edgecolors, linewidths, [], [antialiased], [None])
 
+def draw_gouraud_triangle(self, gc, points, colors, transform):
+"""
+Draw a Gouraud-shaded triangle.
+
+EXPERIMENTAL
+"""
+raise NotImplementedError
+
 def _iter_collection_raw_paths(self, master_transform, paths,
all_transforms):
 """

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-08-07 
17:02:28 UTC (rev 7417)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-08-07 
18:31:45 UTC (rev 7418)
@@ -63,6 +63,7 @@
 self.draw_markers = self._renderer.draw_markers
 self.draw_path_collection = self._renderer.draw_path_collection
 self.draw_quad_mesh = self._renderer.draw_quad_mesh
+self.draw_gouraud_triangle = self._renderer.draw_gouraud_triangle
 self.draw_image = self._renderer.draw_image
 self.copy_from_bbox = self._renderer.copy_from_bbox
 self.tostring_rgba_minimized = self._renderer.tostring_rgba_minimized

Modified: trunk/matplotlib/lib/matplotlib/collections.py
===
--- trunk/matplotlib/lib/matplotlib/collections.py  2009-08-07 17:02:28 UTC 
(rev 7417)
+++ trunk/matplotl

SF.net SVN: matplotlib:[7419] trunk/toolkits/basemap/examples/contour_demo. py

2009-08-07 Thread jswhit
Revision: 7419
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7419&view=rev
Author:   jswhit
Date: 2009-08-07 18:33:02 + (Fri, 07 Aug 2009)

Log Message:
---
add extend='both'

Modified Paths:
--
trunk/toolkits/basemap/examples/contour_demo.py

Modified: trunk/toolkits/basemap/examples/contour_demo.py
===
--- trunk/toolkits/basemap/examples/contour_demo.py 2009-08-07 18:31:45 UTC 
(rev 7418)
+++ trunk/toolkits/basemap/examples/contour_demo.py 2009-08-07 18:33:02 UTC 
(rev 7419)
@@ -22,7 +22,7 @@
 # create contour lines
 CS1 = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
 # fill between contour lines.
-CS2 = m.contourf(x,y,hgt,CS1.levels,cmap=plt.cm.jet)
+CS2 = m.contourf(x,y,hgt,CS1.levels,cmap=plt.cm.jet,extend='both')
 # setup colorbar axes instance.
 pos = ax.get_position()
 l, b, w, h = pos.bounds
@@ -49,7 +49,7 @@
 # make a filled contour plot.
 x, y = m(lons, lats)
 CS1 = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
-CS2 = m.contourf(x,y,hgt,CS1.levels,cmap=plt.cm.jet)
+CS2 = m.contourf(x,y,hgt,CS1.levels,cmap=plt.cm.jet,extend='both')
 pos = ax.get_position()
 l, b, w, h = pos.bounds
 cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
@@ -75,7 +75,7 @@
 # make a filled contour plot.
 x, y = m(lons, lats)
 CS1 = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
-CS2 = m.contourf(x,y,hgt,CS1.levels,cmap=plt.cm.jet)
+CS2 = m.contourf(x,y,hgt,CS1.levels,cmap=plt.cm.jet,extend='both')
 pos = ax.get_position()
 l, b, w, h = pos.bounds
 cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
@@ -101,7 +101,7 @@
 # make a filled contour plot.
 x, y = m(lons, lats)
 CS1 = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
-CS2 = m.contourf(x,y,hgt,CS2.levels,cmap=plt.cm.jet)
+CS2 = m.contourf(x,y,hgt,CS2.levels,cmap=plt.cm.jet,extend='both')
 pos = ax.get_position()
 l, b, w, h = pos.bounds
 cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
@@ -128,7 +128,7 @@
 # make a filled contour plot.
 x, y = m(lons, lats)
 CS1 = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
-CS2 = m.contourf(x,y,hgt,CS2.levels,cmap=plt.cm.jet)
+CS2 = m.contourf(x,y,hgt,CS1.levels,cmap=plt.cm.jet,extend='both')
 pos = ax.get_position()
 l, b, w, h = pos.bounds
 cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes


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:[7420] trunk/matplotlib/src/_backend_agg.cpp

2009-08-07 Thread mdboom
Revision: 7420
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7420&view=rev
Author:   mdboom
Date: 2009-08-07 19:39:27 + (Fri, 07 Aug 2009)

Log Message:
---
Fix segfault in Agg backend

Modified Paths:
--
trunk/matplotlib/src/_backend_agg.cpp

Modified: trunk/matplotlib/src/_backend_agg.cpp
===
--- trunk/matplotlib/src/_backend_agg.cpp   2009-08-07 18:33:02 UTC (rev 
7419)
+++ trunk/matplotlib/src/_backend_agg.cpp   2009-08-07 19:39:27 UTC (rev 
7420)
@@ -1270,9 +1270,11 @@
   _VERBOSE("RendererAgg::draw_path_collection");
   args.verify_length(12);
 
-  GCAgg gc(args[0], dpi);
+  Py::Object gc_obj = args[0];
+  GCAgg gc(gc_obj, dpi);
   agg::trans_affine  master_transform = 
py_to_agg_transformation_matrix(args[1].ptr());
-  PathListGenerator   paths(args[2]);
+  Py::SeqBase path   = args[2];
+  PathListGenerator   path_generator(path);
   Py::SeqBase transforms_obj   = args[3];
   Py::Object  offsets_obj  = args[4];
   agg::trans_affine   offset_trans = 
py_to_agg_transformation_matrix(args[5].ptr());
@@ -1283,7 +1285,6 @@
   Py::SeqBaseantialiaseds= args[10];
   // We don't actually care about urls for Agg, so just ignore it.
   // Py::SeqBase urls = args[11];
-  PathListGenerator path_generator(paths);
 
   try {
 _draw_path_collection_generic


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:[7421] trunk/sample_data/Minduka_Present_Blue_Pack. png

2009-08-07 Thread leejjoon
Revision: 7421
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7421&view=rev
Author:   leejjoon
Date: 2009-08-08 01:40:31 + (Sat, 08 Aug 2009)

Log Message:
---
add ribbon box image

Added Paths:
---
trunk/sample_data/Minduka_Present_Blue_Pack.png

Added: trunk/sample_data/Minduka_Present_Blue_Pack.png
===
(Binary files differ)


Property changes on: trunk/sample_data/Minduka_Present_Blue_Pack.png
___
Added: svn:mime-type
   + application/octet-stream


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:[7422] trunk/matplotlib

2009-08-07 Thread efiring
Revision: 7422
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7422&view=rev
Author:   efiring
Date: 2009-08-08 01:46:44 + (Sat, 08 Aug 2009)

Log Message:
---
Convert slit paths to compound paths inside cntr.c.

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/contour.py
trunk/matplotlib/src/cntr.c

Modified: trunk/matplotlib/lib/matplotlib/contour.py
===
--- trunk/matplotlib/lib/matplotlib/contour.py  2009-08-08 01:40:31 UTC (rev 
7421)
+++ trunk/matplotlib/lib/matplotlib/contour.py  2009-08-08 01:46:44 UTC (rev 
7422)
@@ -539,7 +539,6 @@
 
 """
 self.ax = ax
-self.noslit = kwargs.get('noslit', False) # **Temporary**
 self.levels = kwargs.get('levels', None)
 self.filled = kwargs.get('filled', False)
 self.linewidths = kwargs.get('linewidths', None)
@@ -599,8 +598,6 @@
 self.collections = cbook.silent_list('collections.PathCollection')
 else:
 self.collections = cbook.silent_list('collections.LineCollection')
-self.segs = []
-self.kinds = []
 # label lists must be initialized here
 self.labelTexts = []
 self.labelCValues = []
@@ -629,8 +626,6 @@
  alpha=self.alpha)
 self.ax.add_collection(col)
 self.collections.append(col)
-self.segs.append(segs)
-self.kinds.append(kinds)
 else:
 tlinewidths = self._process_linewidths()
 self.tlinewidths = tlinewidths
@@ -639,7 +634,7 @@
 nlist = C.trace(level)
 nseg = len(nlist)//2
 segs = nlist[:nseg]
-kinds = nlist[nseg:]
+#kinds = nlist[nseg:]
 col = collections.LineCollection(segs,
  linewidths = width,
  linestyle = lstyle,
@@ -648,24 +643,16 @@
 col.set_label('_nolegend_')
 self.ax.add_collection(col, False)
 self.collections.append(col)
-self.segs.append(segs)
-self.kinds.append(kinds)
 self.changed() # set the colors
 
 def _make_paths(self, segs, kinds):
 paths = []
 for seg, kind in zip(segs, kinds):
-codes = np.zeros(kind.shape, dtype=mpath.Path.code_type)
-codes.fill(mpath.Path.LINETO)
-codes[0] = mpath.Path.MOVETO
-# points that begin a slit or are in it:
-# use moveto for any point *following* such a point
-if self.noslit:
-in_slit = kind[:-1] >= _cntr._slitkind
-codes[1:][in_slit] = mpath.Path.MOVETO
-paths.append(mpath.Path(seg, codes))
+paths.append(mpath.Path(seg, codes=kind))
 return paths
 
+
+
 def changed(self):
 tcolors = [ (tuple(rgba),) for rgba in
 self.to_rgba(self.cvalues, alpha=self.alpha)]

Modified: trunk/matplotlib/src/cntr.c
===
--- trunk/matplotlib/src/cntr.c 2009-08-08 01:40:31 UTC (rev 7421)
+++ trunk/matplotlib/src/cntr.c 2009-08-08 01:46:44 UTC (rev 7422)
@@ -1318,9 +1318,134 @@
 site = NULL;
 }
 
+#define MOVETO 1
+#define LINETO 2
 
-/* Build a list of XY 2-D arrays, shape (N,2), to which a list of K arrays
-is concatenated. */
+int reorder(double *xpp, double *ypp, short *kpp,
+double *xy, unsigned char *c, int npts)
+{
+int *i0;
+int *i1;
+int *subp=NULL;  /* initialized to suppress warning */
+int isp, nsp;
+int iseg, nsegs;
+int isegplus;
+int i;
+int k;
+int started;
+int maxnsegs = npts/2 + 1;
+
+/* allocate maximum possible size--gross overkill */
+i0 = malloc(maxnsegs * sizeof(int));
+i1 = malloc(maxnsegs * sizeof(int));
+
+/* Find the segments. */
+iseg = 0;
+started = 0;
+for (i=0; i= kind_slit_up) || (i == npts-1))
+{
+i1[iseg] = i;
+started = 0;
+iseg++;
+if (iseg == maxnsegs)
+{
+k = -1;
+goto ending;
+}
+}
+}
+else if ((kpp[i] < kind_slit_up) && (i < npts-1))
+{
+i0[iseg] = i;
+started = 1;
+}
+}
+
+nsegs = iseg;
+
+
+/* Find the subpaths as sets of connected segments. */
+
+subp = malloc(nsegs * sizeof(int));
+for (i=0; i= 0) continue;
+subp[iseg] = nsp;
+nsp++;
+if (iseg == nsegs-1) continue;
+for (isegplus = iseg+1; isegplus < nsegs; isegplus++)
+{
+if (subp[isegplus] >= 0) continue;
+
+if (xend == xpp[i0[isegplus]] && yend == ypp[i0[isegplus]])
+  

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

2009-08-07 Thread leejjoon
Revision: 7423
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7423&view=rev
Author:   leejjoon
Date: 2009-08-08 02:06:56 + (Sat, 08 Aug 2009)

Log Message:
---
BboxImage implemented and two examples added.

Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/image.py

Added Paths:
---
trunk/matplotlib/examples/pylab_examples/demo_bboximage.py
trunk/matplotlib/examples/pylab_examples/demo_ribbon_box.py

Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG  2009-08-08 01:46:44 UTC (rev 7422)
+++ trunk/matplotlib/CHANGELOG  2009-08-08 02:06:56 UTC (rev 7423)
@@ -1,3 +1,6 @@
+2009-08-07 BboxImage implemented. Two examples, demo_bboximage.py and
+   demo_ribbon_box.py added. - JJL
+
 2009-08-07 In an effort to simplify the backend API, all clipping rectangles
and paths are now passed in using GraphicsContext objects, even
on collections and images.  Therefore:

Added: trunk/matplotlib/examples/pylab_examples/demo_bboximage.py
===
--- trunk/matplotlib/examples/pylab_examples/demo_bboximage.py  
(rev 0)
+++ trunk/matplotlib/examples/pylab_examples/demo_bboximage.py  2009-08-08 
02:06:56 UTC (rev 7423)
@@ -0,0 +1,62 @@
+import matplotlib.pyplot as plt
+import numpy as np
+from matplotlib.image import BboxImage
+from matplotlib.transforms import Bbox, TransformedBbox
+
+if __name__ == "__main__":
+
+fig = plt.figure(1)
+ax = plt.subplot(121)
+
+txt = ax.text(0.5, 0.5, "test", size=30, ha="center", color="w")
+kwargs = dict()
+
+bbox_image = BboxImage(txt.get_window_extent,
+   norm = None,
+   origin=None,
+   clip_on=False,
+   **kwargs
+   )
+a = np.arange(256).reshape(1,256)/256.
+bbox_image.set_data(a)
+ax.add_artist(bbox_image)
+
+
+ax = plt.subplot(122)
+a = np.linspace(0, 1, 256).reshape(1,-1)
+a = np.vstack((a,a))
+
+maps = sorted(m for m in plt.cm.datad if not m.endswith("_r"))
+#nmaps = len(maps) + 1
+
+#fig.subplots_adjust(top=0.99, bottom=0.01, left=0.2, right=0.99)
+
+ncol = 2
+nrow = len(maps)//ncol + 1
+
+xpad_fraction = 0.3
+dx = 1./(ncol + xpad_fraction*(ncol-1))
+
+ypad_fraction = 0.3
+dy = 1./(nrow + ypad_fraction*(nrow-1))
+
+for i,m in enumerate(maps):
+ix, iy = divmod(i, nrow)
+#plt.figimage(a, 10, i*10, cmap=plt.get_cmap(m), origin='lower')
+bbox0 = Bbox.from_bounds(ix*dx*(1+xpad_fraction),
+ 1.-iy*dy*(1+ypad_fraction)-dy,
+ dx, dy)
+bbox = TransformedBbox(bbox0, ax.transAxes)
+
+bbox_image = BboxImage(bbox,
+   cmap = plt.get_cmap(m),
+   norm = None,
+   origin=None,
+   **kwargs
+   )
+
+bbox_image.set_data(a)
+ax.add_artist(bbox_image)
+
+plt.draw()
+plt.show()

Added: trunk/matplotlib/examples/pylab_examples/demo_ribbon_box.py
===
--- trunk/matplotlib/examples/pylab_examples/demo_ribbon_box.py 
(rev 0)
+++ trunk/matplotlib/examples/pylab_examples/demo_ribbon_box.py 2009-08-08 
02:06:56 UTC (rev 7423)
@@ -0,0 +1,140 @@
+import matplotlib.pyplot as plt
+import numpy as np
+from matplotlib.image import BboxImage
+
+from matplotlib._png import read_png
+import matplotlib.colors
+from matplotlib.cbook import get_sample_data
+
+class RibbonBox(object):
+
+original_image = read_png(get_sample_data("Minduka_Present_Blue_Pack.png",
+  asfileobj=False))
+cut_location = 70
+b_and_h = original_image[:,:,2]
+color = original_image[:,:,2] - original_image[:,:,0]
+alpha = original_image[:,:,3]
+nx = original_image.shape[1]
+
+def __init__(self, color):
+rgb = matplotlib.colors.colorConverter.to_rgb(color)
+
+im = np.empty(self.original_image.shape,
+  self.original_image.dtype)
+
+
+im[:,:,:3] = self.b_and_h[:,:,np.newaxis]
+im[:,:,:3] -= self.color[:,:,np.newaxis]*(1.-np.array(rgb))
+im[:,:,3] = self.alpha
+
+self.im = im
+
+
+def get_stretched_image(self, stretch_factor):
+stretch_factor = max(stretch_factor, 1)
+ny, nx, nch = self.im.shape
+ny2 = int(ny*stretch_factor)
+
+stretched_image = np.empty((ny2, nx, nch),
+   self.im.dtype)
+cut = self.im[self.cut_location,:,:]
+stretched_image[:,:,:] = cut
+stretched_image[:self.cut_loca

SF.net SVN: matplotlib:[7424] branches/v0_99_maint/lib/matplotlib/colors.py

2009-08-07 Thread efiring
Revision: 7424
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7424&view=rev
Author:   efiring
Date: 2009-08-08 06:07:06 + (Sat, 08 Aug 2009)

Log Message:
---
Restore default colormap behavior: no color (alpha = 0) for masked data

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

Modified: branches/v0_99_maint/lib/matplotlib/colors.py
===
--- branches/v0_99_maint/lib/matplotlib/colors.py   2009-08-08 02:06:56 UTC 
(rev 7423)
+++ branches/v0_99_maint/lib/matplotlib/colors.py   2009-08-08 06:07:06 UTC 
(rev 7424)
@@ -488,7 +488,10 @@
 if not self._isinit: self._init()
 alpha = min(alpha, 1.0) # alpha must be between 0 and 1
 alpha = max(alpha, 0.0)
-self._lut[:,-1] = alpha
+self._lut[:-1,-1] = alpha  # Don't assign global alpha to i_bad;
+   # it would defeat the purpose of the
+   # default behavior, which is to not
+   # show anything where data are missing.
 mask_bad = None
 if not cbook.iterable(X):
 vtype = 'scalar'


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