Skip to content

Instantly share code, notes, and snippets.

@paleolimbot
Created July 4, 2019 02:45
Show Gist options
  • Select an option

  • Save paleolimbot/e484639f72f775771bc0e2746e4f1efa to your computer and use it in GitHub Desktop.

Select an option

Save paleolimbot/e484639f72f775771bc0e2746e4f1efa to your computer and use it in GitHub Desktop.
# remotes::install_github("paleolimbot/ggplot2@2b2f4fb9ad8ada3c2f614185441db1d790b8db2e")
library(ggplot2)
ggplot(mpg, aes(class, hwy)) +
geom_point() +
guides(
y = guide_axis(order = 2),
y.sec = guide_axis(position = "left", order = 2, angle = 45)
)
@paleolimbot

Copy link
Copy Markdown
Author

This is the current result:

# remotes::install_github("paleolimbot/ggplot2@2b2f4fb9ad8ada3c2f614185441db1d790b8db2e")
library(ggplot2)
ggplot(mpg, aes(class, hwy)) +
  geom_point() +
  guides(
    y = guide_axis(order = 2),
    y.sec = guide_axis(position = "left", order = 2, angle = 45)
  )

The code generating the grob is here:

https://github.com/paleolimbot/ggplot2/blob/2b2f4fb9ad8ada3c2f614185441db1d790b8db2e/R/coord-cartesian-.r#L210-L222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment