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

feat: support custom colors for data/MC plots #399

Merged
merged 8 commits into from
Apr 5, 2023

Conversation

alexander-held
Copy link
Member

@alexander-held alexander-held commented Apr 2, 2023

Adding a new colors argument to visualize.data_mc and visualize.data_mc_from_histograms (as well as visualize.plot_model.data_mc) that allows specifying color names per sample: colors={"signal": "red", "background": "blue"}. Colors need to be provided for all samples, otherwise an exception is raised. If colors are invalid, an exception will later on be raised via matplotlib. The default behavior is unchanged, falling back to the seaborn-colorblind colors.

visualize.data_mc_from_histograms was still missing the channels kwarg, this is now also included.

* support custom histogram colors for visualize.data_mc via new colors keyword argument
* support custom histogram colors in visualize.plot_model.data_mc
* extend color and channel filtering functionality to visualize.data_mc_from_histograms

resolves #381 (rest of that issue migrated to #265)

@codecov
Copy link

codecov bot commented Apr 2, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d761e30) 100.00% compared to head (44c2666) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #399   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines         2066      2078   +12     
  Branches       327       334    +7     
=========================================
+ Hits          2066      2078   +12     
Impacted Files Coverage Δ
src/cabinetry/visualize/__init__.py 100.00% <100.00%> (ø)
src/cabinetry/visualize/plot_model.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@alexander-held alexander-held mentioned this pull request Apr 5, 2023
5 tasks
@alexander-held alexander-held merged commit ec88440 into master Apr 5, 2023
7 checks passed
@alexander-held alexander-held deleted the feat/custom-data-mc-colors branch April 5, 2023 17:14
@alexander-held alexander-held added this to In progress in v0.6 via automation May 12, 2023
@alexander-held alexander-held moved this from In progress to Done in v0.6 May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v0.6
Done
Development

Successfully merging this pull request may close these issues.

Histogram colors in stacks - user interface creation
1 participant