2
我有這樣一個數據幀:如何給R中的直方圖的一個標籤着色?
CellLines ZEB1
600MPE 2.8186
AU565 2.783
BT20 2.7817
BT474 2.6433
BT483 2.4994
BT549 3.035
CAMA1 2.718
DU4475 2.8005
HBL100 2.6745
HCC38 3.2884
HCC70 2.597
HCC202 2.8557
HCC1007 2.7794
HCC1008 2.4513
HCC1143 2.8159
HCC1187 2.6372
HCC1428 2.7327
HCC1500 2.7564
HCC1569 2.8093
我能畫一個柱狀圖和標籤添加到(感謝這裏的人對自己的這個「Make a histogram clearer by assigning names to different segments of each bar in R」幫助)。我想知道是否有一種方法僅對直方圖上的一個標籤着色,例如只有顏色「HCC1008」。 的代碼到目前爲止(感謝@Carlos的Cinelli):
Heiser_hist <- hist(Heiser$ZEB1[1:19], breaks=50, col="grey")
Heiser$cut <- cut(Heiser$ZEB1, breaks=Heiser_hist$breaks)
library(dplyr)
Heiser <- Heiser %>% group_by(cut) %>% mutate(pos = seq(from=1, to=2, length.out=length(ZEB1)))
with(Heiser, text(ZEB1, pos, labels=CellLines, srt=45, cex=0.9))
應該提到的是,我檢查這些網頁,但似乎沒有人解決這個問題: Intelligent point label placement in R,Labeling not all points on the plot
謝謝在此之前提供任何幫助:-)
嗨ssdecontrol!感謝您的評論和對延遲:-) – 2014-11-04 03:43:13