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

Skip to content

Escape octothorpe characters in matplotlibrc #19289

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 4 commits into from

Conversation

janniklasrose
Copy link

@janniklasrose janniklasrose commented Jan 13, 2021

PR Summary

Fixes #19288

When parsing matplotlibrc files, the octothorpe (#) indicates a comment. Escaping with \# now allows the parameter value itself to contain #. For example,

text.latex.preamble: \newcommand{\foo}[1]{\bar{\#1}} # add foo as shorthand for bar

results in rcParams["text.latex.preamble"] == "\\newcommand{\\foo}[1]{\\bar{#1}}" as desired.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • 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).

Fixes matplotlib#19288 

When parsing matplotlibrc files, the octothorpe ('#') indicates a comment. Escaping with '\#' allows the parameter value to contain '#'
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@anntzer
Copy link
Contributor

anntzer commented Apr 12, 2021

I agree with @timhoffm that quoted strings would be nicer (#19288 (comment)).

@melissawm
Copy link
Member

Hi @janniklasrose - are you interested in continuing this work? If so, please mark the PR as ready for review and let us know if you need help with the rebase, we have instructions for that here. Thanks!

@anntzer
Copy link
Contributor

anntzer commented Jun 15, 2023

I think this is effectively superseded by #22589, though.

@timhoffm
Copy link
Member

Closing because #22589 should solve the issue. Pleased report back in case there is still need for this PR.

@timhoffm timhoffm closed this Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Escape # character in matplotlibrc
4 participants