0
I am mounting this graphic using the ggplot2 package and prefer it with more neutral colors as in the first image (without vibrant colors), but when I modify the order of the caption the colors of the graphic are modified as well, moving to those of the second image.
"Scale for 'Fill' is already present. Adding Another Scale for 'Fill', which will replace the existing Scale."
This is the return when I try to add the command to change the order of the legend when I already have the colors I want set.
Follow the script without the code to change the order of the legend:
ggplot(data=dfDNA, aes(x=Spp, y=Prop, fill=Elementos)) + geom_bar(stat="identity") + scale_fill_brewer(palette="Dark2") + xlab("Espécies")+ylab("Proproção") + guides(fill=guide_legend(title="Elementos Repetitivos"))
Follow the command to change the order of subtitles:
+ scale_fill_discrete(breaks=c("Gypsy", "Copia", "LINE", "SINE", "Transposons", "DNA Satélite", "Sem Classificação"))
You can set colors manually: 'scale_color_manual(values = c("#E7B800", "#2E9FDF", "#FC4E07"))'
– Daniel Ikenaga
@Daniel unfortunately did not work either. Did not return anything and nor changed the colors.
– Alex Silvestrini