Revision: 8819
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8819&view=rev
Author:   mdboom
Date:     2010-12-09 17:25:11 +0000 (Thu, 09 Dec 2010)

Log Message:
-----------
[3123736] tex processor crashes when fed a space

Modified Paths:
--------------
    branches/v1_0_maint/lib/matplotlib/text.py

Modified: branches/v1_0_maint/lib/matplotlib/text.py
===================================================================
--- branches/v1_0_maint/lib/matplotlib/text.py  2010-12-06 14:43:16 UTC (rev 
8818)
+++ branches/v1_0_maint/lib/matplotlib/text.py  2010-12-09 17:25:11 UTC (rev 
8819)
@@ -551,6 +551,9 @@
 
         if rcParams['text.usetex']:
             for line, wh, x, y in info:
+                if not np.isfinite(x) or not np.isfinite(y):
+                    continue
+
                 x = x + posx
                 y = y + posy
                 if renderer.flipy():
@@ -566,6 +569,9 @@
                                       self._fontproperties, angle)
         else:
             for line, wh, x, y in info:
+                if not np.isfinite(x) or not np.isfinite(y):
+                    continue
+
                 x = x + posx
                 y = y + posy
                 if renderer.flipy():
@@ -974,6 +980,8 @@
         # Did we find an even number of non-escaped dollar signs?
         # If so, treat is as math text.
         if rcParams['text.usetex']:
+            if s == ' ':
+                s = r'\ '
             return s, 'TeX'
 
         if cbook.is_math_text(s):


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

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to