0
I’m trying to change the order of the bars so that they appear in the same order as in fill
(from top to bottom: a
, b
, c
).
df3<-data.frame(Locus =rep(c("gene1","gene2"), 3),
variable = c("a", "a", "b", "b", "c", "c"),
value = c(-2.855996957,
-2.859492255,
-1.362416086,
-5.36910352,
1.493580871,
-2.509611265))
ggplot(df3, aes(x = Locus, y = value, fill = variable,
order = as.numeric(variable))) +
geom_col(position = "dodge") +
scale_fill_manual(values=c("yellow", "red", "blue"))+
labs(title = NULL,
x = NULL,
y = "",
fill = "Tratamentos")+
coord_flip()+
theme_classic()
Peter, welcome to [en.so]. Do not use greetings or greetings, see what kind of behavior is expected from users?
– gleisin-dev