Revision: 5333
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5333&view=rev
Author:   jdh2358
Date:     2008-05-30 12:38:42 -0700 (Fri, 30 May 2008)

Log Message:
-----------
Merged revisions 5312-5313,5329 via svnmerge from 
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint

........
  r5312 | cmoad | 2008-05-29 15:59:43 -0700 (Thu, 29 May 2008) | 1 line
  
  tagging new version
........
  r5313 | cmoad | 2008-05-29 20:07:39 -0700 (Thu, 29 May 2008) | 1 line
  
  minor rev bump
........
  r5329 | jdh2358 | 2008-05-30 12:21:56 -0700 (Fri, 30 May 2008) | 1 line
  
  added support for None for dvipng and removed the sqrt in the hack which I 
think is wrong
........

Modified Paths:
--------------
    trunk/matplotlib/MIGRATION.txt
    trunk/matplotlib/lib/matplotlib/rcsetup.py
    trunk/matplotlib/lib/matplotlib/texmanager.py
    trunk/matplotlib/matplotlibrc.template

Property Changed:
----------------
    trunk/matplotlib/


Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
   - /branches/v0_91_maint:1-5307
   + /branches/v0_91_maint:1-5330

Modified: trunk/matplotlib/MIGRATION.txt
===================================================================
--- trunk/matplotlib/MIGRATION.txt      2008-05-30 19:29:09 UTC (rev 5332)
+++ trunk/matplotlib/MIGRATION.txt      2008-05-30 19:38:42 UTC (rev 5333)
@@ -31,7 +31,7 @@
 If you already have a working copy of the trunk, your next "svn up" will
 include the latest transforms changes.  
 
-Before installing, make sure you completely remove the old matplotlib
+IMPORTANT: Before installing, make sure you completely remove the old 
matplotlib
 build and install directories, eg: 
 
     > cd matplotlib

Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/rcsetup.py  2008-05-30 19:29:09 UTC (rev 
5332)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py  2008-05-30 19:38:42 UTC (rev 
5333)
@@ -43,6 +43,16 @@
     else:
         raise ValueError('Could not convert "%s" to boolean' % b)
 
+def validate_bool_maybe_none(b):
+    'Convert b to a boolean or raise'
+    if type(b) is str:
+        b = b.lower()
+    if b=='none': return None
+    if b in ('t', 'y', 'yes', 'on', 'true', '1', 1, True): return True
+    elif b in ('f', 'n', 'no', 'off', 'false', '0', 0, False): return False
+    else:
+        raise ValueError('Could not convert "%s" to boolean' % b)
+
 def validate_float(s):
     'convert s to float or raise'
     try: return float(s)
@@ -338,7 +348,7 @@
     'text.usetex'         : [False, validate_bool],
     'text.latex.unicode'  : [False, validate_bool],
     'text.latex.preamble' : [[''], validate_stringlist],
-    'text.dvipnghack'     : [False, validate_bool],
+    'text.dvipnghack'     : [None, validate_bool_maybe_none],
     'text.fontstyle'      : ['normal', str],
     'text.fontangle'      : ['normal', str],
     'text.fontvariant'    : ['normal', str],

Modified: trunk/matplotlib/lib/matplotlib/texmanager.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/texmanager.py       2008-05-30 19:29:09 UTC 
(rev 5332)
+++ trunk/matplotlib/lib/matplotlib/texmanager.py       2008-05-30 19:38:42 UTC 
(rev 5333)
@@ -366,7 +366,12 @@
             pngfile = self.make_png(tex, fontsize, dpi)
             X = readpng(os.path.join(self.texcache, pngfile))
 
-            if self._dvipng_hack_alpha or rcParams['text.dvipnghack']:
+            if rcParams['text.dvipnghack'] is not None:
+                hack = rcParams['text.dvipnghack']
+            else:
+                hack = self._dvipng_hack_alpha
+            print 'using hack', hack
+            if hack:
                 # hack the alpha channel
                 # dvipng assumed a constant background, whereas we want to
                 # overlay these rasters with antialiasing over arbitrary
@@ -388,7 +393,8 @@
                 #
                 # Since the foreground is black (0) and the background is
                 # white (1) this reduces to red = 1-alpha or alpha = 1-red
-                alpha = np.sqrt(1-X[:,:,0])
+                #alpha = npy.sqrt(1-X[:,:,0]) # should this be sqrt here?
+                alpha = 1-X[:,:,0]
             else:
                 alpha = X[:,:,-1]
 

Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template      2008-05-30 19:29:09 UTC (rev 
5332)
+++ trunk/matplotlib/matplotlibrc.template      2008-05-30 19:38:42 UTC (rev 
5333)
@@ -147,9 +147,14 @@
                             # beware of package collisions: color, geometry, 
graphicx,
                             # type1cm, textcomp. Adobe Postscript (PSSNFS) 
font packages
                             # may also be loaded, depending on your font 
settings
-#text.dvipnghack     : False  # some versions of dvipng don't handle
-                             # alpha channel properly.  Use True to correct 
and flush
-                             # ~/.matplotlib/tex.cache before testing
+
+#text.dvipnghack : None      # some versions of dvipng don't handle alpha
+                             # channel properly.  Use True to correct
+                             # and flush ~/.matplotlib/tex.cache
+                             # before testing and False to force
+                             # correction off.  None will try and
+                             # guess based on your dvipng version
+
 #text.markup         : 'plain'  # Affects how text, such as titles and labels, 
are
                                 # interpreted by default.
                                 # 'plain': As plain, unformatted text


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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to