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

problems with colors in geom_encirce() #79

Open
danielsangarci opened this issue May 25, 2022 · 0 comments
Open

problems with colors in geom_encirce() #79

danielsangarci opened this issue May 25, 2022 · 0 comments

Comments

@danielsangarci
Copy link

Hello,

I would like to ask you about how I could I manually change the color of the circles I get with geom_encircle. The colors I get in the circles does not match with the ones I set in the dots and I cannot manage to change it.

I share my code and the graph I get to show you my problem with the colors

plot1m <- ggplot(fit1m.plot, aes(x=comp1, y=comp2, color=factor(pop_year, level = c("NL2020", "NL1996", "PL1990", "PL2003", "PL2019"))))+  
geom_point(size=2)+
  geom_encircle(aes(fill = pop_year), s_shape = 0.5, expand = 0.02,
                  alpha = 0.2, show.legend = FALSE)+
  scale_x_continuous(name=plot1m.pre[["plot.args"]][["xlab"]])+
  scale_y_continuous(name=plot1m.pre[["plot.args"]][["ylab"]])+
  scale_colour_manual(name="Group", values = mypalette)+
theme(axis.title.x = element_text(size=title.size, colour = 'black'),
        axis.title.y = element_text(size=title.size, color = 'black'),
        axis.text.x = element_text(size=text.size, colour = 'black'),
        axis.text.y = element_text(size=text.size, colour = 'black'),
        axis.line=element_line(colour='black', size=line.size),
        panel.grid.major = element_line(),
        panel.border = element_rect(fill = NA),
        panel.background = element_blank())+
  coord_fixed(ratio = diff(xlim)/diff(ylim), xlim=xlim, ylim=ylim, expand=F)

Thank you so much in advance.

example

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