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?
Relevel external_gene_name to match the order you want or instead fill by norm_count. As an aside, you should get rid of the legend. The colors don't actually add anything, though I suppose people like colorful charts.
The order of the colouring is decided by the order (or, in R speak, the levels) of your factor variable "external_gene_name". By default, factors are ordered in alphabetical order (as shown in the legend). You need to re-level the factor to reflect that the order is based on "norm_count_1".
Check the "factor" function in R for more info - or if you post some of your dataframe, we can probably help with the code.
It works perfectly. Thank you.
Good stuff - I was guessing