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

Idea: make rug guide #39

Open
teunbrand opened this issue Dec 16, 2024 · 1 comment
Open

Idea: make rug guide #39

teunbrand opened this issue Dec 16, 2024 · 1 comment
Labels
💡 feature New feature or request

Comments

@teunbrand
Copy link
Owner

Like geom_rug(), but part of a guide.
If using for position guides, might have to manually feed data, as position guides cannot read data from plot.

@teunbrand teunbrand added the 💡 feature New feature or request label Dec 16, 2024
@teunbrand
Copy link
Owner Author

teunbrand commented Dec 16, 2024

Just realising we're already 90% there

library(legendry)
#> Loading required package: ggplot2

ggplot(mtcars, aes(wt, mpg, colour = drat)) +
  geom_point() +
  guides(
    x = guide_axis_stack("axis", primitive_ticks(key = key_manual(mtcars$wt))),
    y = guide_axis_stack("axis", primitive_ticks(key = key_manual(mtcars$mpg))),
    colour = guide_colbar(second_guide = primitive_ticks(
      key = key_manual(mtcars$drat),
      theme = theme(legend.ticks.length = unit(2.75, "pt"),
                    legend.ticks = element_line(colour = "black", linewidth = 0.5))
    ))
  )

Created on 2024-12-16 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant