Skip to content

Fix legend border artifact in ppc_freqpoly#537

Open
utkarshpawade wants to merge 3 commits intostan-dev:masterfrom
utkarshpawade:fix/134/legendborder
Open

Fix legend border artifact in ppc_freqpoly#537
utkarshpawade wants to merge 3 commits intostan-dev:masterfrom
utkarshpawade:fix/134/legendborder

Conversation

@utkarshpawade
Copy link
Copy Markdown
Contributor

Fixes #134

  • ppc_freqpoly() and ppc_freqpoly_grouped() displayed a visible dark border around the y legend key due to the color aesthetic from geom_area() bleeding into the legend glyph
  • Added guides(fill = guide_legend(override.aes = list(color = NA))) to suppress the outline color in legend keys

Before
image

After
image

Copilot AI review requested due to automatic review settings April 10, 2026 05:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a ggplot2 legend rendering artifact in the posterior predictive check frequency polygon plots (ppc_freqpoly() and, transitively, ppc_freqpoly_grouped()), where the geom_area() outline color was bleeding into the legend key.

Changes:

  • Add a guides(fill = guide_legend(override.aes = list(color = NA))) override to suppress the outline color in the fill legend key for ppc_freqpoly().
  • Document the fix in NEWS.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
R/ppc-distributions.R Overrides legend aesthetics for the fill guide to remove the unwanted border artifact in freqpoly PPC plots (also affects grouped variant via delegation).
NEWS.md Adds a changelog entry describing the legend border artifact fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.15%. Comparing base (44c3e5c) to head (4a4e176).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #537   +/-   ##
=======================================
  Coverage   99.15%   99.15%           
=======================================
  Files          35       35           
  Lines        5920     5921    +1     
=======================================
+ Hits         5870     5871    +1     
  Misses         50       50           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

legend border on ppc_freqpoly_grouped

3 participants