0
可能重複:
how to plot a bar chart with non-sorted x-axis (lattice)如何使用格繪製條形圖沒有分類x軸
我想繪製條形圖。但我不知道如何用格子中未排序的x軸來繪製它。默認情況下,格陣將排序我不期望的x數據。
我的代碼顯示如下:
代碼:
go=data.frame(number_of_Unigene=c(45,5328,30,30,119,3248,16594,244,4354,3547,917,429,3716,30,15726,4182,1673,877,30,30,640,4808,2462,2437,7812,190,2001,30,44,19852,1763,19852,31,30,686,30,3698,9829,3432,1439,15252,6024,1753,216,15917,15103,30,433,319,30,522,708,30,102,30,613,1039,30,2478),class=c("biological adhesion","biological regulation","carbon utilization","cell killing","cell proliferation","cellular component organization or biogenesis","cellular process","death","developmental process","establishment of localization","growth","immune system process","localization","locomotion","metabolic process","multicellular organismal process","multi-organism process","negative regulation of biological process","nitrogen utilization","pigmentation","positive regulation of biological process","regulation of biological process","reproduction","reproductive process","response to stimulus","rhythmic process","signaling","sulfur utilization","viral reproduction","cell","cell junction","cell part","extracellular matrix","extracellular matrix part","extracellular region","extracellular region part","macromolecular complex","membrane","membrane part","membrane-enclosed lumen","organelle","organelle part","symplast","antioxidant activity","binding","catalytic activity","channel regulator activity","electron carrier activity","enzyme regulator activity","metallochaperone activity","molecular transducer activity","nucleic acid binding transcription factor activity","nutrient reservoir activity","protein binding transcription factor activity","protein tag","receptor activity","structural molecule activity","translation regulator activity","transporter activity"),Ontology=c("biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","biological_process","cellular_component","cellular_component","cellular_component","cellular_component","cellular_component","cellular_component","cellular_component","cellular_component","cellular_component","cellular_component","cellular_component","cellular_component","cellular_component","cellular_component","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function","molecular_function"))
下一個
library(lattice)
barchart(go[,1]~go[,2],horiz=F,ylim=c(30,29666),layout=c(1,1),stack=F,
auto.key=list(space='right'),ylab="Number of unigenes",
scales=list(x=list(rot=45),y=list(log=T)))
還有什麼應該怎麼辦?
非常感謝。你能告訴我如何在劇情中增加一條水平線嗎?以及如何在正確的y標籤上添加y軸? – Sandy
格子有一個'lline'函數。在Lattic尺度參數中有很多選項。你提出的問題確實有不同的問題。 –