Skip to content

Do not change order of positive and negative values in PositionStack - #3471

Merged
thomasp85 merged 2 commits into
v3.2.1-rcfrom
ribbon-fix
Aug 9, 2019
Merged

thomasp85 merged 2 commits into
v3.2.1-rcfrom
ribbon-fix

Conversation

@thomasp85

Copy link
Copy Markdown
Member

fixes #3390

@karawoo I have checked that this fix does not cause regressions in #1552. Basically what this does is avoid positive and negative y-values to get reordered, not fiddle with the group-based reordering

@thomasp85 thomasp85 added this to the ggplot2 3.2.1 milestone Aug 5, 2019
@thomasp85
thomasp85 requested a review from clauswilke August 5, 2019 07:45
Comment thread R/position-stack.r
}

rbind(neg, pos)
rbind(neg, pos)[match(seq_len(nrow(data)), c(which(negative), which(!negative))),]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see immediately that this is always correct. Can there be problems with NAs? Or will NAs never reach this point?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

An NA value in ymax is pretty nonsensical and would also have broken the previous code. I can put in some guarding if you’d like nonetheless

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No strong opinion either way. Just make sure to look into why the CI builds fail.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The failures are due to the downstream changes in sf, which have been fixed in master but not yet merged into the v3.2.1-rc branch

@karawoo karawoo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, I'll close #3401

@lock

lock Bot commented Feb 5, 2020

Copy link
Copy Markdown

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock Bot locked and limited conversation to collaborators Feb 5, 2020
@thomasp85
thomasp85 deleted the ribbon-fix branch October 6, 2025 11:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants