Viz 02: Harmonise 1D distribution plots (histogram + KDE)#1718
Draft
Doresic wants to merge 4 commits into
Draft
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## viz-01-cluster-palette #1718 +/- ##
==========================================================
+ Coverage 84.33% 84.38% +0.05%
==========================================================
Files 165 165
Lines 14796 14926 +130
==========================================================
+ Hits 12478 12596 +118
- Misses 2318 2330 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





It makes sense to make
parameter_histandsampling_1d_marginals(the two 1D distribution plotters) to behave the same: same bounds handling, same axis labels, same legend layout, same argument vocabulary, as they are very similar plotters.Main changes:
show_bounds: bool = True— when true, the plot frames to the parameter bounds and draws bound lines; when false, it frames tightly to the data. xlim is set explicitly from bounds + actual data, so the KDE tail extension never dominates the visible rangedash_color(matching the bar-edge family) so individual data points stay readable on the lighter histogramplot_density_panelinmisc.pydoing the histogram / KDE / rug / bounds rendering — takes a resolvedstyledictplot_type, bins, bw_method, show_bounds, title, size, ax/axes, style_kwargs), andsampling_1d_marginalsgainedbins(was hardcoded). Tidied up some confusing docstrings along the way (stepsizeis a thinning factor;start_indicessubsets starts whileparameter_indicessubsets parameters)apply_style()in_style.py— a small opt-in rcParams preset (top/right spines off, framed legends, constrained layout). General so later PRs in the series just call itLINE_*for any line (KDE, simulation, …),DASH_*for any tick marker (rug, CI endpoints, …). The naming principle is documented in_style.pyso future PRs follow itparameter_histgainsbw_methodandtitle; its legacycolorkwarg is deprecated — usestyle_kwargs={"rectangle_color": ..., "line_color": ..., "dash_color": ...}insteadprocess_deprecated_kwarginmisc.pygains a removal mode (canonical_name=None) and anote=parameter for custom messages — used here for thecolordeprecation; PR 09b will reuse itGRID_SIZE_PER_COL/GRID_SIZE_PER_ROWin_style.pywire intoget_axes_array'ssize=Nonedefault so every multi-panel plotter inherits consistent panel sizingThis is the second in the small series of visualisation PRs. Before/after PNGs below.