在geom_bar()中为propotional值设置y轴限制

时间:2015-09-20 11:48:43

标签: r ggplot2

有谁知道为什么ylim在我的数据中不起作用?我希望y轴从0到1。

combine_tumor_normal

                prop                           type Sample
1   0.308095119627677 Non-templated Additions (NTAs)  Tumor
2  0.0394774366971475                    5' trimming  Tumor
3   0.102235193938622                      5'tailing  Tumor
4   0.313920256306014                     3' tailing  Tumor
5    0.23627199343054                    3' trimming  Tumor
6   0.313938376463918 Non-templated Additions (NTAs) Normal
7  0.0382192572629843                    5' trimming Normal
8   0.103500517272483                      5'tailing Normal
9   0.313912604881138                     3' tailing Normal
10  0.230429244119477                    3' trimming Normal

ggplot(combine_tumor_normal, aes(type,prop, fill=type)) + 
                 geom_bar(stat="identity") + 
                 facet_wrap(~Sample, scales = "free_y") +
                 theme_bw(base_size=12) + 
                 labs(x = "", y = "Fraction of IsomiRs") +
                 theme(axis.text.y = element_blank()) +
                 ylim(0, 1)
  

错误:提供给连续刻度的离散值

0 个答案:

没有答案