Skip to content

Replace PlotKit submodule with redesigned pure-Python PlotKit (#171)#278

Merged
kandrosov merged 10 commits into
cms-flaf:mainfrom
kandrosov:issue-171-plotkit-redesign
Jul 1, 2026
Merged

Replace PlotKit submodule with redesigned pure-Python PlotKit (#171)#278
kandrosov merged 10 commits into
cms-flaf:mainfrom
kandrosov:issue-171-plotkit-redesign

Conversation

@kandrosov

Copy link
Copy Markdown
Contributor

Summary

Replaces the legacy kandrosov/PlotKit submodule with the redesigned, pure-Python
cms-flaf/PlotKit (merged in cms-flaf/PlotKit#1) — matplotlib +
mplhep by default, optional ROOT + cmsstyle. The swap is transparent: Analysis/HistPlotter.py is
unchanged and the analysis config/plot/*.yaml files keep their format, so only the submodule (URL +
pointer) and the env change. Fixes #171.

Changes

  • .gitmodules: PlotKit URL kandrosov/PlotKitcms-flaf/PlotKit; submodule pointer advanced to
    the merged main.
  • run_tools/mk_flaf_env.sh: pip install cmsstyle (optional ROOT backend; lazy-imported, so nothing
    breaks before the next env rebuild — mplhep already comes from LCG).
  • docs/: glossary, architecture and the HistPlotTask reference updated to describe the new PlotKit
    (mplhep/cmsstyle, standalone python -m PlotKit.cli, and the signal_plot_scale: bkg option).
    mkdocs build --strict passes.
  • Analysis/HistPlotter.py: unchanged — the preserved legacy Plotter API makes the swap
    transparent.

Testing

  • Verified end-to-end on real HH_bbWW all_plots histograms (Run3_2023): the HistPlotTask
    plotting path (HistPlotter.py → PlotKit) renders faithful stacked plots (CMS/lumi/channel/
    category/region labels, divide_by_bin_width, stacked backgrounds + bkg-uncertainty band + scaled
    signals + data + Obs/Bkg ratio), through both the mplhep and cmsstyle backends.
  • PlotKit's own suite is 16/16; mkdocs build --strict passes.

Companion PR

  • HH_bbWW: switches config/global.yaml to signal_plot_scale: bkg (normalise each signal to the
    summed background — a new PlotKit capability).

@kandrosov

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15155590 started

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15155590 failed

@kandrosov

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15161294 started

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15161294 failed

@kandrosov

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot please test

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15162086 started

@kandrosov

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot please test

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15162161 started

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15162086 failed

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15162161 failed

@kandrosov

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15164400 started

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15164400 failed

@kandrosov

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15167139 started

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15167139 passed

@kandrosov

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15167394 started

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15167394 failed

@kandrosov

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot please test

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15167712 started

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15167712 passed

@kandrosov kandrosov merged commit c4d8011 into cms-flaf:main Jul 1, 2026
7 checks passed
@kandrosov kandrosov deleted the issue-171-plotkit-redesign branch July 1, 2026 11:10
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.

Redesign plotting code

2 participants