|
From: <ef...@us...> - 2011-02-10 01:21:34
|
Revision: 8968
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8968&view=rev
Author: efiring
Date: 2011-02-10 01:21:27 +0000 (Thu, 10 Feb 2011)
Log Message:
-----------
bugfix: handle alpha correctly in colormapping with uint8
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colors.py
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py 2011-02-09 17:57:14 UTC (rev 8967)
+++ trunk/matplotlib/lib/matplotlib/colors.py 2011-02-10 01:21:27 UTC (rev 8968)
@@ -547,6 +547,8 @@
if alpha is not None:
alpha = min(alpha, 1.0) # alpha must be between 0 and 1
alpha = max(alpha, 0.0)
+ if bytes:
+ alpha = int(alpha * 255)
if (lut[-1] == 0).all():
lut[:-1, -1] = alpha
# All zeros is taken as a flag for the default bad
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|