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

Comments

@hadley
Copy link
Member

@hadley 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")
  )
@thomasp85
Copy link
Member

@thomasp85 thomasp85 commented Nov 10, 2016

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

@R-Joe
Copy link

@R-Joe 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

@duttashi duttashi commented Dec 12, 2016

@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

@karawoo karawoo closed this in #2094 Jul 3, 2017
@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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants