Skip to content

coord_map(): moving y axis to the right does not move all axis elements #3042

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

Closed
W-L opened this issue Dec 20, 2018 · 1 comment · Fixed by #3069
Closed

coord_map(): moving y axis to the right does not move all axis elements #3042

W-L opened this issue Dec 20, 2018 · 1 comment · Fixed by #3069

Comments

@W-L
Copy link

W-L commented Dec 20, 2018

Hi,
this is almost identical to issue #2005 (fixed by #2062) but for coord_map(), instead of coord_polar(). When the y-axis is moved to the right by scale_y_continuous(position = "right"), only the axis label is moved. I adapted the reprex from that previous issue:

library(ggplot2)

df <- data.frame(
  heights = c(100, 110, 120, 130, 140, 150), 
  weights = c(50.1, 55.1, 60.1, 65.1, 70.1, 75.1)
)

plot <- ggplot(df, ggplot2::aes(x = heights, y = weights, group = 1)) + 
  geom_line(color = "purple") + 
  coord_map()

# OK
plot 

# NOT OK: Label moves, but rest does not
plot + scale_y_continuous(position = "right")

okplot
notokplot

Cheers!

@lock
Copy link

lock bot commented Jul 18, 2019

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 Jul 18, 2019
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 a pull request may close this issue.

1 participant