|
From: Gregor T. <gre...@gm...> - 2008-12-12 18:01:28
|
I found that in scatter plots the alpha values given by individual
entries in the color list are ignored. Here an example that shows
different combinations of color and alpha arguments:
x = [1,2,3]
y = array([1,1,1])
c = [[1,0,0, 0.0],
[1,0,0, 0.5],
[1,0,0, 1.0]]
scatter(x, y, s = 200, c = 'r')
scatter(x, y + 1, s = 200, c = c)
scatter(x, y + 2, s = 200, c = c, alpha = 0.5)
scatter(x, y + 3, s = 200, c = 'g', alpha = 0.5)
Looking at the source in axes.py/scatter I found that replacing the
default value for the alpha keyword argument in the function header of
scatter from alpha=1.0 to alpha=None fixes this problem. Additionally, I
had to replace
collection.set_alpha(alpha)
by
if alpha is not None:
collection.set_alpha(alpha)
See also the attached diff file.
Gregor
|