
ggplot() + 
  geom_bar(data = plotDf,
           aes(x = reorder(plotDf$sample_id), y = counts, fill = condition), 
           stat = 'identity') + 
labs(x = 'Sample') + 
theme_bw() +
theme(axis.text.x = element_text(angle = 90))+ 
scale_fill_manual (values = cbPalette)
Hello everyone,
The above is my code and barplot.  I would like to change the order of sample and legend to 'wt''wt_dia''wt_afn', 'wt_2mut', 'wt_1mut' , which is same as in my dataframe(plotDf). but here apparently, the order is shown in an alphabetical manner. Thanks very much!
 
    