Hello,

Dateutil 2.0 is now available for Python 3.x at <http://niemeyer.net/python-dateutil>.

The example user_interfaces/mathtext_wx.py is broken since as_rgba_str() was removed from the ft2font extension. A patch is attached.

Christoph
diff --git a/examples/user_interfaces/mathtext_wx.py 
b/examples/user_interfaces/mathtext_wx.py
index 06197bb..9d19e09 100644
--- a/examples/user_interfaces/mathtext_wx.py
+++ b/examples/user_interfaces/mathtext_wx.py
@@ -5,7 +5,7 @@ controls on wxPython.
 
 import matplotlib
 matplotlib.use("WxAgg")
-from numpy import arange, sin, pi, cos, log
+from numpy import arange, sin, pi, cos, log, zeros
 from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
 from matplotlib.backends.backend_wx import NavigationToolbar2Wx
 from matplotlib.figure import Figure
@@ -22,9 +22,10 @@ from matplotlib.mathtext import MathTextParser
 mathtext_parser = MathTextParser("Bitmap")
 def mathtext_to_wxbitmap(s):
     ftimage, depth = mathtext_parser.parse(s, 150)
-    return wx.BitmapFromBufferRGBA(
-        ftimage.get_width(), ftimage.get_height(),
-        ftimage.as_rgba_str())
+    rgba = zeros((ftimage.get_height(), ftimage.get_width(), 4), dtype='uint8')
+    rgba[...,3] = ftimage.as_array()
+    return wx.BitmapFromBufferRGBA(ftimage.get_width(), ftimage.get_height(),
+                                   rgba)
 ############################################################
 
 functions = [
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to