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

Add lplot! for Dict{Symbol, NamedTuple} #9

Merged
merged 2 commits into from
Feb 26, 2025
Merged

Add lplot! for Dict{Symbol, NamedTuple} #9

merged 2 commits into from
Feb 26, 2025

Conversation

fhagemann
Copy link
Contributor

Some functions in LegendSpecFits return a dictionary of reports, for example LegendSpecFits.fit_peaks.

This PR adds a plot recipe to create a plot from the individual reports but still provides a title etc.
I also modified the plot recipe for histogram fits with custom components.

result_fit, report_fit = LegendSpecFits.fit_peaks(result_simple.peakhists, result_simple.peakstats, th228_names;
    e_unit=result_simple.unit, calib_type=:th228, m_cal_simple=m_cal_simple)

LegendMakie.lplot(report_fit, figsize = (600, 400*length(report_fit)), 
    title = get_plottitle(filekey, det, "Peak Fits"; additiional_type=string(e_type)))

image

It is not so easy for this plot to prevent the legend to clash with the histogram or fit lines.
One could adjust the plot recipe of the histogram fit such that the background line is always plotted in the lowest 20%. However, this only works, if there is a "flat" background component.

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.71%. Comparing base (0e23b46) to head (bd4a308).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
+ Coverage   91.11%   91.71%   +0.60%     
==========================================
  Files           9        9              
  Lines         304      314      +10     
==========================================
+ Hits          277      288      +11     
+ Misses         27       26       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fhagemann fhagemann merged commit f670f44 into main Feb 26, 2025
9 checks passed
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.

1 participant