Revision: 6934
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6934&view=rev
Author:   mdboom
Date:     2009-02-25 15:39:34 +0000 (Wed, 25 Feb 2009)

Log Message:
-----------
Fix crashes with empty data and step draw style.

Modified Paths:
--------------
    branches/v0_98_5_maint/lib/matplotlib/lines.py

Modified: branches/v0_98_5_maint/lib/matplotlib/lines.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/lines.py      2009-02-25 07:36:55 UTC 
(rev 6933)
+++ branches/v0_98_5_maint/lib/matplotlib/lines.py      2009-02-25 15:39:34 UTC 
(rev 6934)
@@ -458,10 +458,11 @@
         funcname = self._lineStyles.get(self._linestyle, '_draw_nothing')
         if funcname != '_draw_nothing':
             tpath, affine = 
self._transformed_path.get_transformed_path_and_affine()
-            self._lineFunc = getattr(self, funcname)
-            funcname = self.drawStyles.get(self._drawstyle, '_draw_lines')
-            drawFunc = getattr(self, funcname)
-            drawFunc(renderer, gc, tpath, affine.frozen())
+            if len(tpath.vertices):
+                self._lineFunc = getattr(self, funcname)
+                funcname = self.drawStyles.get(self._drawstyle, '_draw_lines')
+                drawFunc = getattr(self, funcname)
+                drawFunc(renderer, gc, tpath, affine.frozen())
 
         if self._marker is not None:
             gc = renderer.new_gc()
@@ -472,8 +473,9 @@
             funcname = self._markers.get(self._marker, '_draw_nothing')
             if funcname != '_draw_nothing':
                 tpath, affine = 
self._transformed_path.get_transformed_points_and_affine()
-                markerFunc = getattr(self, funcname)
-                markerFunc(renderer, gc, tpath, affine.frozen())
+                if len(tpath.vertices):
+                    markerFunc = getattr(self, funcname)
+                    markerFunc(renderer, gc, tpath, affine.frozen())
 
         renderer.close_group('line2d')
 


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

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to