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

your pkg with dark bg #12

Open
PythonCoderUnicorn opened this issue Nov 11, 2021 · 1 comment
Open

your pkg with dark bg #12

PythonCoderUnicorn opened this issue Nov 11, 2021 · 1 comment

Comments

@PythonCoderUnicorn
Copy link

Hello,

I decided to try out your pkg and made a rainbow colored ggpol.

when I save this image or use RStudio clipboard it shows white bg edges so i screen captured this

Screen Shot 2021-11-11 at 4 24 10 PM

my initial try was to put ggdark::dark_mode() at the end for a dark plot but that did not work. here is the code i used to make my plot dark, maybe you will find it useful

# install.packages("ggpol")
library(ggpol)

rb = data.frame(
  flag = factor( c('red','orange','yellow',
                   'green','blue','purple')),
  seats = c(200, 46, 92, 80, 153, 69),
  colors = c('red','orange','yellow',
             'green','blue','purple')
)

ggplot(rb) + 
  geom_parliament(aes(seats = seats,
                      fill = flag), 
                  color = "black") + 
  scale_fill_manual(values = rb$colors, 
                    labels = rb$flag) +
  labs(title = "\nParliamentary diagram {ggpol} #PrideFlag")+
  coord_fixed() + 
  theme(
    text = element_text(family = "Rubik"),
    plot.title = element_text(size = 14, 
                              hjust = 0.5
                              ),
    panel.grid.major = element_line(linetype = "blank"),
    panel.grid.minor = element_line(linetype = "blank"),
    legend.text = element_text(colour = "white"),
    legend.title = element_markdown(size = 12,
                                    colour = "white"), 
    panel.background = element_rect(fill = "gray0"),
    plot.background = element_rect(fill = "gray0"),
    legend.background = element_rect(fill = "gray0"),
    legend.position = "bottom", legend.direction = "horizontal",
    axis.text.x = element_blank(),
    axis.text.y = element_blank(),
    axis.ticks = element_blank()
    )

Thanks for the package. : )

@erocoar
Copy link
Owner

erocoar commented May 26, 2022

Thanks, looks awesome! I'll try to figure out why ggdark is not working as intended 😄

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