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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with displaying country flags #13

Open
rempsyc opened this issue Jun 18, 2023 · 0 comments
Open

Help with displaying country flags #13

rempsyc opened this issue Jun 18, 2023 · 0 comments

Comments

@rempsyc
Copy link

rempsyc commented Jun 18, 2023

Hi, thank you for this great package. I am trying to replace the squares by country flags. Here is my current attempt:

library(ggplot2)
library(emojifont)
library(ggwaffle)

iris2 <- iris
iris2$Species <- c("馃嚭馃嚫", "馃嚚馃嚘", "馃嚞馃嚙")

waffle_data <- waffle_iron(iris2, aes_d(group = Species))
waffle_data$label = fontawesome('fa-flag')

ggplot(waffle_data, aes(x, y, colour = group)) +
  geom_text(aes(label=label), family='fontawesome-webfont', size=7) +
  coord_equal() +
  scale_colour_waffle() +
  theme_waffle()

Created on 2023-06-18 with reprex v2.0.2

Is it possible at all with ggwaffle? I was trying to play with ggflags as well but I don't see how to make these two compatible because ggflags replace points in a scatter plot. Thanks.

Here is my stackoverflow question for reference: https://stackoverflow.com/questions/76501103/how-to-display-country-flags-on-waffle-chart-symbols-using-e-g-ggwaffle

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

1 participant