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

Make annotate_logticks coord_flip-aware #4431

Merged
merged 2 commits into from
Apr 27, 2021

Conversation

thomasp85
Copy link
Member

Fix #3954

This PR ensures that annotate_logticks() works in the presence of coord_flip(). It does so by flipping around the ranges and aesthetic names.

Important notice: With this PR, sides = "b" will not get translated to sides = "l". Since the sides argument is positional and not tied to aesthetic names it makes sense to me to leave it alone

@thomasp85 thomasp85 added this to the ggplot2 3.3.4 milestone Apr 19, 2021
@@ -126,13 +126,15 @@ GeomLogticks <- ggproto("GeomLogticks", Geom,
mid = unit(0.2, "cm"), long = unit(0.3, "cm"))
{
ticks <- list()
flipped <- inherits(coord, "CoordFlip")
Copy link
Member

Choose a reason for hiding this comment

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

This feels a bit too specific to this problem. Are there any other way to check if the coord is flipped? (I guess the answer is no, but let me just confirm...)

Copy link
Member Author

Choose a reason for hiding this comment

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

The answer is no :-)... We have these annoying specific logic pertaining to coord_flip around the code base and there is not really much to do about it at this time

We can discuss a more throughout fix at a later stage but that is beyond this fix

Copy link
Member

Choose a reason for hiding this comment

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

I see, thanks for clarifying.

@thomasp85 thomasp85 merged commit bb8f960 into master Apr 27, 2021
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.

conflict of coord_flip() with annotation_logticks()
2 participants