Last active
December 22, 2021 20:52
-
-
Save brshallo/78d0682d16b7eb09ee39caa4eba3fc06 to your computer and use it in GitHub Desktop.
Nice way to pass in arbitrary labels to plotly::ggplotly()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
custom_ggplot <- function(df, x, y, ...){ | |
ggplot(mpg, aes(x = cty, y = hwy, ...))+ | |
geom_point() | |
} | |
custom_ggplot(color = class) | |
p <- custom_ggplot(class = class, displ = displ) | |
plotly::ggplotly(p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment