0

int_times

gene       lag     stim num
 a1  46.53000 173.5300   1
 a2 101.47000 162.5900   2
 a3  14.00000 259.0000   3
 a4   6.43276 134.1821   4
 a5  28.00000 182.0000   5
 a6  16.00000 198.0000   6

这是我的gg代码

   ggplot(int_times,aes(x=stim,y= num,colour=gene)) +
       scale_y_continuous(labels=c('should not exist',int_times$gene)) +
       # geom_line(aes(position)) +
       geom_segment(aes(xend=length(stim),yend=.01)) +
       xlab('x') +
       ylab('y') +          
       opts(title = 'Multiple Gs')    

我不知道如何让 hline 工作,但我希望一切都像现在这样,除了每条线是它对应的 y 轴上的单独水平段 在此处输入图像描述

4

1 回答 1

1

看看这对你有什么作用:

   ggplot(int_times,aes(x=stim,y=gene ,colour=gene)) +
       geom_segment(aes(xend=length(stim),ystart=gene, yend=gene)) +
       xlab('x') +
       ylab('y') +          
       opts(title = 'Multiple Gs')   

Doug 我编辑并为 y 提供了基因,因为无论如何这似乎是你想要的 y 轴。

于 2012-09-14T23:26:57.337 回答