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

Autorotate discrete #1032

Merged
merged 4 commits into from
Apr 8, 2024
Merged

Autorotate discrete #1032

merged 4 commits into from
Apr 8, 2024

Conversation

RYangazov
Copy link
Collaborator

@RYangazov RYangazov commented Feb 29, 2024

The behavior of jitter and jitter_dodge changes when the orientation is altered.
Even when the seed value is set, the distribution of geom_point() isn't maintained.
image

This is due to JitterPos.translate applying random coefficients to the coordinates in a different sequence.
This kind of behavior is also seen in ggplot2

@IKupriyanov-HORIS IKupriyanov-HORIS marked this pull request as ready for review February 29, 2024 21:19
Copy link
Collaborator

@alshan alshan left a comment

Choose a reason for hiding this comment

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

IMO it should be done differently.

  1. There should be a function which inspects layer's geom/stat and defines if "orientation" is applicable to the layer. For example, true if stat "count", or true if geom "bar".

  2. The decision about layer's orientation should be done only at the "backend", before stat is applied.

  3. If concluded that orientation is "y", then add option "orientation=y" to the layer's options (see fun replaceOwnData() for example).

  4. If only aes Y is mapped, then orientation is definitely Y.

  5. If both aes - X and Y are mapped, then check whether the Y is discrete (mappings, data). And no need to combine dataframes to perform this checking. However, if X is discrete, then no need to check Y.

@RYangazov RYangazov marked this pull request as draft March 15, 2024 11:09
@RYangazov RYangazov marked this pull request as ready for review March 22, 2024 13:52
@RYangazov RYangazov requested a review from alshan March 22, 2024 13:52
@RYangazov RYangazov marked this pull request as draft March 22, 2024 16:46
@RYangazov RYangazov removed the request for review from alshan March 22, 2024 16:46
@RYangazov RYangazov marked this pull request as ready for review March 26, 2024 16:28
@RYangazov RYangazov requested a review from alshan March 26, 2024 16:29
@RYangazov RYangazov marked this pull request as draft March 27, 2024 10:27
@RYangazov RYangazov force-pushed the autorotate-discrete branch 3 times, most recently from 73a6d7d to 87c71b2 Compare April 2, 2024 16:03
@RYangazov RYangazov marked this pull request as ready for review April 2, 2024 16:04
@RYangazov RYangazov requested a review from alshan April 2, 2024 16:04
@RYangazov RYangazov requested a review from alshan April 8, 2024 09:50
@alshan alshan merged commit 85dbbed into master Apr 8, 2024
@IKupriyanov-HORIS IKupriyanov-HORIS deleted the autorotate-discrete branch May 14, 2024 18:08
@IKupriyanov-HORIS IKupriyanov-HORIS restored the autorotate-discrete branch May 14, 2024 18:08
@RYangazov RYangazov deleted the autorotate-discrete branch May 14, 2024 18:24
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.

None yet

2 participants