Issue
Some of my plots have several million lines. I dynamically adjust the alpha
value, by the number of lines, so that the outliers more or less disappear, while the most prominent features appear clear. But for some alpha
's, the lines just disappear.
What is the smallest valid alpha
value for line plots in in matplotlib? And why is there a lower limit?
Solution
As @ImportanceOfBeingErnest suggested in the comments, the lower limit seems to be 1/255
.
I did not have time to go though the source code and all, but I did test it, and assume what happens is, that the input alpha
value needs to be represented as an int between 0 and 255:
int(alpha*255)
When the input alpha
value is smaller than 1/255
, e.g. 1/256
, it is therefore represented by a 0
, and the plot lines disappear. Whereas when the alpha
is 1/255
(or slightly larger), it is converted to 1
, and the plot lines can be seen.
Answered By - Hallgeir Wilhelmsen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.