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

Groups not sorted similarly when position='stack' #673

Closed
ASmirnov-HORIS opened this issue Jan 24, 2023 · 0 comments · Fixed by #676
Closed

Groups not sorted similarly when position='stack' #673

ASmirnov-HORIS opened this issue Jan 24, 2023 · 0 comments · Fixed by #676
Assignees
Milestone

Comments

@ASmirnov-HORIS
Copy link
Collaborator

Discrete case

Example:

data = {
    'x': [0, 0, 1, 1],
    'y': [1, 1, 1, 1],
    'g': ['A', 'B', 'B', 'A']
}
ggplot(data, aes('x', 'y', color='g')) + geom_point(position='stack', size=10)

Result:

Expected (as in ggplot2):

Continuous case

Example:

data = {
    'x': [0, 0, 1, 1],
    'y': [1, 1, 1, 1],
    'g': [1.0, 2.0, 2.0, 1.0]
}
ggplot(data, aes('x', 'y', color='g', group='g')) + geom_point(position='stack', size=10)

The problem looks the same. But in this case it should only be fixed when group aesthetic is specified. Otherwise, sorting in ggplot2 also doesn't work.

@ASmirnov-HORIS ASmirnov-HORIS self-assigned this Jan 24, 2023
ASmirnov-HORIS added a commit that referenced this issue Jan 27, 2023
alshan pushed a commit that referenced this issue Feb 1, 2023
* Add grouping to position 'stack'. Add possibility to stack position only between groups.

* Refactor StackPos.

* Refactor offset calculator.

* Add tests for the StackPos.

* Upgrade StackPos a bit, and add tests for 'max' offset.

* Mention issue #673 after fixing it.

* Upgrade code and tests for StackPos.

* Refactor StackPos.

* Refactor StackPos.StackingContext.

* Renaming in the StackPos.StackingContext.

* Remove callback from the StackPos.StackingContext.
@IKupriyanov-HORIS IKupriyanov-HORIS added this to the 2023Q1 milestone Feb 15, 2023
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 a pull request may close this issue.

2 participants