Replace stat_function() with geom_function() and fix override.aes size (#449)#450
Open
ishaan-arora-1 wants to merge 4 commits intostan-dev:masterfrom
Open
Conversation
- overlay_function() now wraps geom_function() instead of the older stat_function(), matching modern ggplot2 conventions - Use linewidth instead of size in override.aes for line-based legend keys in mcmc-traces.R and ppd-distributions.R - Update documentation and tests accordingly Closes stan-dev#449
Member
|
Thanks. this seems like a change we should make but we have a failing test: https://github.com/stan-dev/bayesplot/actions/runs/22910316067/job/66500925400?pr=450#step:7:1175 |
The override.aes change from size to linewidth affects the legend key rendering, so these snapshots need to be regenerated.
Contributor
Author
|
@jgabry only ubuntu fails, we can merge now right? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #450 +/- ##
==========================================
- Coverage 98.63% 98.55% -0.09%
==========================================
Files 35 35
Lines 5860 5864 +4
==========================================
- Hits 5780 5779 -1
- Misses 80 85 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Fixes #449.
overlay_function()was wrappingstat_function(), which has been superseded bygeom_function()since ggplot2 3.3.0. Switched it over — the API is compatible since we just pass...through.Also fixed
override.aes = list(size = ...)inmcmc-traces.Rwhere it was used for a linetype legend key — should belinewidthsince ggplot2 3.4.0. (The similar case inppd-distributions.Ris already handled by #430.)Tests and docs updated accordingly.