Here are a few patches that we in Sage have been applying to our version 
of matplotlib.  I'm wondering if some or all of these might be 
incorporated into matplotlib, or if not, if you could comment on these 
patches.  I've updated the following diffs to be against 0.99.0.  I've 
separated the patches with a bunch of dashes.


lib/matplotlib/cbook.py: The background information for this patch is 
found at http://trac.sagemath.org/sage_trac/ticket/1967 and 
http://groups.google.com/group/sage-support/browse_thread/thread/edcf2740f7276e6a?hl=en#78ee7d78a0a99f12

--- src/lib/matplotlib/cbook.py    2009-08-01 12:15:07.000000000 -0700
+++ patches/cbook.py    2009-08-08 23:15:21.000000000 -0700
@@ -14,7 +14,10 @@
 
 
 # on some systems, locale.getpreferredencoding returns None, which can 
break unicode
-preferredencoding = locale.getpreferredencoding()
+try:
+    preferredencoding = locale.getpreferredencoding()
+except:
+    preferredencoding = None
 
 def unicode_safe(s):
     if preferredencoding is None: return unicode(s)



-----------------------------------------------------------------------------------------------------------------------------------------------


lib/matplotlib/patches.py:  The comment attached to this patch was  '* 
Add a patch for patches.py, which ignores the errors generated when 
trying to draw arrows that are "too short".'  I actually made this 
patch, so if it isn't obvious what the patch is doing and why it was 
causing an error before, I can try to remember and construct an example.

--- src/lib/matplotlib/patches.py    2009-08-01 12:15:07.000000000 -0700
+++ patches/patches.py    2009-08-08 23:25:09.000000000 -0700
@@ -2326,15 +2326,21 @@
                 x, y = path.vertices[0]
                 insideA = inside_circle(x, y, shrinkA)
 
-                left, right = split_path_inout(path, insideA)
-                path = right
+                try:
+                    left, right = split_path_inout(path, insideA)
+                    path = right
+                except ValueError:
+                    pass
 
             if shrinkB:
                 x, y = path.vertices[-1]
                 insideB = inside_circle(x, y, shrinkB)
 
-                left, right = split_path_inout(path, insideB)
-                path = left
+                try:
+                    left, right = split_path_inout(path, insideB)
+                    path = left
+                except ValueError:
+                    pass
 
             return path
 


---------------------------------------------------------------------------------------------------------------------------------------
ttconv/pprdrv_tt2.cpp: This patch is *only* applied when `uname` = 
"SunOS".  The comment is: Copy patched version of pprdrv_tt2.cpp for 
Solaris 10 that builds with gcc 4.3.2.


--- src/ttconv/pprdrv_tt2.cpp    2009-08-01 12:15:15.000000000 -0700
+++ patches/pprdrv_tt2.cpp    2009-08-08 23:33:24.000000000 -0700
@@ -104,7 +104,8 @@
     {                /* have a log of points. */
     if(stack_depth == 0)
         {
-            stream.put_char('{');
+            //  Note the below is a hack to make it compile on Solaris 
10 with gcc 4.3.2
+            stream.puts("{");
             stack_depth=1;
             }
 


--------------------------------------------------------------------------------------------------------------------------------------------

setupext.py: The background for this patch is here: 
http://trac.sagemath.org/sage_trac/ticket/4176


--- src/setupext.py     2009-08-01 12:15:24.000000000 -0700
+++ patches/setupext.py 2009-08-08 23:43:29.000000000 -0700
@@ -1034,6 +1038,7 @@
         #      of distros.
 
         # Query Tcl/Tk system for library paths and version string
+        tk_ver = ''
         try:
             tcl_lib_dir, tk_lib_dir, tk_ver = query_tcltk()
         except:



Thanks!

Jason





------------------------------------------------------------------------------
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-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to