You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A line collection can have variable line width, face color, edge color, antialiasing, and offests but the alpha is fixed. It seems odd that so much variation is possible except when it comes to transparency. This is a headache to deal with when plotting a large number of line segments, would it be possible to make the alpha variable accept a list instead of a single float?
I don't know why I didn't think of this, thanks for pointing it out. Regardless it would be nice to have the alpha interface when passing in a color map and array.
One difficulty with that has to do with the underlying mechanisms of the AGG rastering. As I understand it (and I am not super familiar with that bit of code so I could be wrong), the alpha kwargs is used when the whole artist is composited into the figure and is implemented way up the class stack. Changing how this is handled could turn into a major re-write.
Just a thought but a switch could be added somewhere in the class chain that catches if alpha is an array and constructs the corresponding rgba values array from the cmap.
@acadien That does sound reasonable, I suspect the correct place is in Collection. I don't have the bandwidth to look at that right now, but if you want to that would be great!
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
tacaswell commentedon Oct 14, 2014
You can achieve this effect by passing RGBA tuples for the colors.
acadien commentedon Oct 14, 2014
I don't know why I didn't think of this, thanks for pointing it out. Regardless it would be nice to have the alpha interface when passing in a color map and array.
tacaswell commentedon Oct 14, 2014
One difficulty with that has to do with the underlying mechanisms of the AGG rastering. As I understand it (and I am not super familiar with that bit of code so I could be wrong), the
alphakwargs is used when the whole artist is composited into the figure and is implemented way up the class stack. Changing how this is handled could turn into a major re-write.acadien commentedon Oct 14, 2014
Just a thought but a switch could be added somewhere in the class chain that catches if alpha is an array and constructs the corresponding rgba values array from the cmap.
tacaswell commentedon Oct 14, 2014
@acadien That does sound reasonable, I suspect the correct place is in
Collection. I don't have the bandwidth to look at that right now, but if you want to that would be great!github-actions commentedon Oct 9, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
story645 commentedon Nov 8, 2023
This is frequently asked for and we allow list alphas in other places
greglucas commentedon Nov 8, 2023
I'm pretty sure this works now. Adding

alpha=np.linspace(0.1, 1, N)to the line collection example: https://matplotlib.org/stable/gallery/shapes_and_collections/line_collection.html shows a blended alpha.