Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ENH]: set facecolor and edgecolor alpha separately #24681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
story645 opened this issue Dec 9, 2022 · 0 comments · Fixed by #24691
Closed

[ENH]: set facecolor and edgecolor alpha separately #24681

story645 opened this issue Dec 9, 2022 · 0 comments · Fixed by #24691

Comments

@story645
Copy link
Member

story645 commented Dec 9, 2022

Problem

I like making diagrams where my patch edge is solid but the fill is semi-transparent - in my case usually to fade out the color, but it's also useful to emphasize boundaries

image

Since alpha applies to the whole patch, the way I do this now is by converting my HTML colors into RGBs and appending an A

edgecolor=x_color, facecolor=(*mcolors.to_rgb(x_color), .10)

ETA: apparently I could also just do facecolor = mcolors.to_rgba(x_color, .10)

Proposed solution

Allow alpha to take a (facecolor, fillcolor) tuple for patch methods. As an example of prior art, we allow vectorized/separable alphas in imshow as of #14889

@story645 story645 added the status: needs comment/discussion needs consensus on next step label Dec 11, 2022
@QuLogic QuLogic added this to the v3.8.0 milestone Mar 20, 2023
@QuLogic QuLogic removed the status: needs comment/discussion needs consensus on next step label Mar 20, 2023
@ksunden ksunden changed the title [ENH]: set facecolor and edgecolor alpha seperately [ENH]: set facecolor and edgecolor alpha separately Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants