I have the following graph bar: genes vs. normalised gene counts (link bellow). I have the results appearing in an descending order. However the color gradient that I used to fill the bars doesn't appear in that descending order. Anyone can help me to fix it?
here is the code that I used:
ggplot(de_results_midline_highest_lowest [1:20,], aes(x = reorder (external_gene_name, norm_count_1), y = norm_count_1, fill= external_gene_name)) + geom_bar(position="dodge", stat="identity") + xlab("Gene") + ylab("Normalized Counts") + coord_flip()+ labs(color = "Gene") + guides(fill=guide_legend(title= "Gene")) + scale_fill_manual(values = colorRampPalette(brewer.pal(12, "Spectral"))(20))