Skip to content

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
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
@thomasp85 thomasp85 deleted the issue-3954-annotate-logticks-flip branch October 6, 2025 11:58
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()

3 participants