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

Issue with ggplotly #78

Open
AlejandroAyllon opened this issue Mar 16, 2021 · 1 comment
Open

Issue with ggplotly #78

AlejandroAyllon opened this issue Mar 16, 2021 · 1 comment

Comments

@AlejandroAyllon
Copy link

When I try to use ggplotly in order to show tooltips I get the following error message:
Error: margins must be length 1 or 4

It can be solved if you comment line 281 in original function code (https://github.com/hrbrmstr/waffle/blob/master/R/waffle.R) and rename the function:

waffle2 <- function(...){
...
# gg <- gg + theme(panel.spacing = unit(c(0, 0, 0, 0), "null"))
...
}

I have tested with the following example and it works:

data <- c('Yes' = 24, 'No' = 76)
g1 <- waffle2(
  data,
  rows = 10,
  colors =  c("#4E79A7", "#A0CBE8"),
  flip = TRUE
  ) +
  ggtitle("Waffle") +
  theme(
    plot.title = element_text(hjust = 0.5, size = 27, face = "bold"),
    legend.position = "none",
  )
ggplotly(g1)

P.S. I will try to change the tooltip.

@rempsyc
Copy link

rempsyc commented Jun 4, 2023

Thanks, I was looking for a solution to this

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

No branches or pull requests

2 participants