使用CSV格式的此數據集並感謝來自stackoverflow的輸入/幫助我設法繪製了帶有使用ggplot的「組」的彩色水平條和條的barplot!這是我第一次使用ggplot。R ggplot在「barplot-like」圖中的排序條
GO Biological Process,regulation of lipid metabolic process,1.87E-35
GO Biological Process,acute inflammatory response,3.21E-37
GO Biological Process,response to insulin stimulus,1.05E-38
GO Biological Process,steroid metabolic process,4.19E-39
GO Biological Process,cholesterol metabolic process,1.19E-40
GO Biological Process,cellular response to chemical stimulus,5.87E-42
GO Biological Process,alcohol metabolic process,5.27E-43
GO Biological Process,sterol metabolic process,2.61E-43
GO Biological Process,lipid homeostasis,1.12E-44
GO Biological Process,response to peptide hormone stimulus,1.29E-45
GO Biological Process,monocarboxylic acid metabolic process,2.33E-54
GO Biological Process,cellular ketone metabolic process,5.46E-74
GO Biological Process,carboxylic acid metabolic process,2.41E-76
GO Biological Process,organic acid metabolic process,5.30E-79
Pathway Commons,FOXA transcription factor networks,7.40E-61
Pathway Commons,FOXA2 and FOXA3 transcription factor networks,1.39E-64
Transcription Factor Targets,"Targets of HNF6, identified by ChIP-chip in hepatocytes",1.77E-32
Transcription Factor Targets,"Targets of HNF1alpha, identified by ChIP-chip in hepatocytes",3.87E-65
Transcription Factor Targets,"Targets of HNF4alpha, identified by ChIP-chip in hepatocytes",1.38E-131
這是我的代碼:
ggplot(tmp, aes(x=tmp$V2, y=-log10(tmp$V3), fill=tmp$V1)) +
geom_bar(stat="identity") +
coord_flip()
現在我想創建同積同上,但其中每個「羣」中的值進行排序。看起來像這樣的東西。
我是新來ggplot,所以任何幫助將不勝感激。 謝謝。
本
我想你錯過了ggplot函數的關閉')'。我會自己編輯它,但它少於6個字符。 – Kevin
@凱文很好趕! Sneeky語法,我第一次總是弄錯了 –