Skip to content

Support Matplotlib 3.7 package style registration (fix #20)#28

Open
cafeco09 wants to merge 5 commits into
mckinsey:masterfrom
cafeco09:feat/mpl37-style-registration
Open

Support Matplotlib 3.7 package style registration (fix #20)#28
cafeco09 wants to merge 5 commits into
mckinsey:masterfrom
cafeco09:feat/mpl37-style-registration

Conversation

@cafeco09

@cafeco09 cafeco09 commented Feb 11, 2026

Copy link
Copy Markdown
  • Adds root-level Matplotlib style sheets under qbstyles/ (qb-common.mplstyle, qb-dark.mplstyle, qb-light.mplstyle) so Matplotlib ≥ 3.7 can load styles via plt.style.use("qbstyles.<style>").
  • Keeps existing style sheets under qbstyles/styles/ to preserve backwards compatibility with any current usage.
  • Updates packaging (MANIFEST.in) so the new .mplstyle files are included in built distributions.
  • Improves packaging robustness by ensuring requirements handling doesn’t hard-fail during sdist/wheel builds.

Usage (Matplotlib ≥ 3.7):

import matplotlib.pyplot as plt
plt.style.use(["qbstyles.qb-common", "qbstyles.qb-dark"])   # dark
# or
plt.style.use(["qbstyles.qb-common", "qbstyles.qb-light"])  # light

Testing / Verification:

  • Built wheel locally and verified it contains:

    • qbstyles/qb-common.mplstyle, qbstyles/qb-dark.mplstyle, qbstyles/qb-light.mplstyle
    • and the original qbstyles/styles/qb-*.mplstyle files.

Fixes #20.

@cafeco09

Copy link
Copy Markdown
Author

Built wheel locally and verified the styles are included in the distribution:
qbstyles/qb-{common,dark,light}.mplstyle and legacy qbstyles/styles/qb-*.mplstyle.
Quick test:
python -c "import matplotlib.pyplot as plt; plt.style.use(['qbstyles.qb-common','qbstyles.qb-dark']); print('OK')"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch to new matplotlib 3.7 style registration mechanism

1 participant