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

Need theme setting for right/top ticks #1899

Closed
hadley opened this issue Nov 10, 2016 · 3 comments
Closed

Need theme setting for right/top ticks #1899

hadley opened this issue Nov 10, 2016 · 3 comments
Assignees
Labels
feature a feature request or enhancement themes 💃

Comments

@hadley
Copy link
Member

hadley commented Nov 10, 2016

So you can do (e.g.)

ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  geom_hline(yintercept = 235 / l_breaks, colour = "pink") +
  scale_y_continuous(
    "mpg",
    sec.axis = sec_axis(~ 235 / ., name = "l / 100 km", breaks = l_breaks)
  ) +
  theme(
    axis.text.y.right = element_text(colour = "pink"), 
    axis.ticks.y.right = element_line(colour = "pink")
  )
@hadley hadley added the feature a feature request or enhancement label Nov 10, 2016
@thomasp85
Copy link
Member

Yeah, I ran into something similar a couple of days ago (not pink though😊)

@R-Joe
Copy link

R-Joe commented Nov 25, 2016

I also ran into a situation where the right/top axis and ticks need some customization.
Looking forward to see this feature in ggplot2 👍

@duttashi
Copy link

@hadley I am not able to reproduce the above code. I get the following error, Error in data.frame(yintercept = yintercept) : object 'l_breaks' not found
is there something I'm missing with? My environment variables are > version platform x86_64-w64-mingw32 arch x86_64 os mingw32 system x86_64, mingw32 status major 3 minor 3.1 year 2016 month 06 day 21 svn rev 70800 language R version.string R version 3.3.1 (2016-06-21) nickname Bug in Your Hair

@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement themes 💃
Projects
None yet
Development

No branches or pull requests

4 participants