Skip to content
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

Feature request: allow a default line alpha to be set in mpl.rcParams #5461

Closed
evandhall opened this issue Nov 11, 2015 · 8 comments
Closed
Milestone

Comments

@evandhall
Copy link

Currently, one can set default line properties like color, marker style, line width, etc. with mpl.rcParams. However, the ability to set a default line alpha seems to be missing. It would be great to have 'lines.alpha' as a key in the rcParams dict, similar to 'lines.color', 'lines.marker', etc.

@evandhall evandhall changed the title Feature request: allow a default alpha to be set in mpl.rcParams Feature request: allow a default line alpha to be set in mpl.rcParams Nov 11, 2015
@mdboom
Copy link
Member

mdboom commented Nov 11, 2015

You can choose a color that includes alpha, i.e. #ffffff88.

@evandhall
Copy link
Author

Thanks, I also see this is a duplicate of issue #5132.

@WeatherGod
Copy link
Member

@mdboom, the hex colorspec does not support the optional alpha channel. It
is an open feature request to add such support. If the support is there
deep in the colors.py code and I did not see it, then the validator needs
to be updated.

On Wed, Nov 11, 2015 at 8:57 AM, evandhall notifications@github.com wrote:

Thanks, I also see this is a duplicate of issue #5132
#5132.


Reply to this email directly or view it on GitHub
#5461 (comment)
.

@mdboom
Copy link
Member

mdboom commented Nov 11, 2015

Ok -- sorry for creating confusion. If it isn't supported, I think it should be. I think separating color from alpha has been a long term mistake. To the extent that we're cleaning up color usage and specification, I think we should encourage more use of RGBA.

@anntzer
Copy link
Contributor

anntzer commented May 5, 2016

This issue also makes #6196 (Qt editor drops alpha) difficult to solve. I am willing to tackle this but would also like to take advantage of this to deprecate some old stuff (because there's going to be some API breakage anyways).

I think the public color conversion API should be something like:

  • is_color_like (any -> bool),
  • to_hex (3-tuple -> #rrggbb, 4-tuple or other color-like -> #rrggbbaa),
  • to_rgba (any -> 4-tuple),
  • to_rgba_array
    (module-level functions)

and drop out rgb2hex, hex2color (both are confusing in the presence of alpha) and the whole colorConverter class (by the way I haven't managed to make the "Cn" syntax work but it looks like caching on that class would lead to issues if someone changes the rcParams in between?).

@tacaswell
Copy link
Member

It is not obvious to me that this requires breaking any API or removing any functionality.

We need to keep the rgb only version around because some backends (ps) do not support alpha.

@anntzer
Copy link
Contributor

anntzer commented May 19, 2016

I think this and #5132 should be closed by #6382.

@WeatherGod
Copy link
Member

closed via #6382

@QuLogic QuLogic added this to the 2.1 (next point release) milestone May 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants