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)
大家好,
以上是我的代码和barplot。我想将示例和图例的顺序更改为'wt'wt_dia'wt_afn','wt_2mut','wt_1mut',与我的dataframe(plotDf)
中的相同。但是这里显然是按字母顺序显示的。非常感谢!