Skip to content

Clarify handling of #rrggbb(aa) colors in matplotlibrc. #22565

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
wants to merge 1 commit into from

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 25, 2022

The inconsistency is not that great, but let's at least document it.

See https://discourse.matplotlib.org/t/specifying-hex-colors-in-style-sheets/22624.

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

stmp = '#' + s
if is_color_like(stmp):
return stmp
# Support "rrggbb"/"rggbbaa" without leading '#' because these would be
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rggbbaa -> rrggbbaa

it's just in comments, but...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for noting that, fixed.

The inconsistency is not that great, but let's at least document it.
@timhoffm
Copy link
Member

We should consider whether this is the direction we want to go.

Right now, the functionality is there, but likely almost nobody uses it because it's not documented. By documenting we encourage adoption. I'd rather not do that. Instead we should follow up on #19954, so that we can do text.color : "#ff0000', which is far better than the current solution.

@anntzer
Copy link
Contributor Author

anntzer commented Feb 28, 2022

No strong opinion there (other than my oft-stated opinion about the matplotlibrc syntax in general).

timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 3, 2022
This enables using the comment character # within strings.

Closes matplotlib#19288.
Superseeds matplotlib#22565.
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 4, 2022
This enables using the comment character # within strings.

Closes matplotlib#19288.
Superseeds matplotlib#22565.
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Mar 4, 2022
This enables using the comment character # within strings.

Closes matplotlib#19288.
Superseeds matplotlib#22565.
@timhoffm
Copy link
Member

timhoffm commented Mar 6, 2022

Superseeded by #22589.

@timhoffm timhoffm closed this Mar 6, 2022
@anntzer anntzer deleted the csrc branch March 6, 2022 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants