In mpl_toolkits.mplot3d, I noticed that if I want to add text in the
Axes3D, I need to use Axes3D.text3D .  However, that method doesn't
pass in kwargs to set the text properties onto the Axes.text method.
Hence, I made this simple modification that passes kwargs on text3D on
to text so that the properties are properly applied.  Attached is the
diff against an up-to-date svn...

This has also been submitted as sourceforge bug ID 2972928
Index: lib/mpl_toolkits/mplot3d/axes3d.py
===================================================================
--- lib/mpl_toolkits/mplot3d/axes3d.py	(revision 8196)
+++ lib/mpl_toolkits/mplot3d/axes3d.py	(working copy)
@@ -511,9 +511,16 @@
         '''
         self._draw_grid = on
 
-    def text(self, x, y, z, s, zdir=None):
-        '''Add text to the plot.'''
-        text = Axes.text(self, x, y, s)
+    def text(self, x, y, z, s,**kwargs):
+        """
+        Add text to the plot.  kwargs are the same as for Axes.text except 
+        for the `zdir` keyword, which sets the direction of the z input.
+        """
+        if 'zdir' in kwargs:
+            zdir = kwargs.pop('zdir')
+        else:
+            zdir = None
+        text = Axes.text(self, x, y, s,**kwargs)
         art3d.text_2d_to_3d(text, z, zdir)
         return text
 
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to