How can I stack several manhattan plots in the same plot looks like this https://imgur.com/a/pj40c  using R?

That plot is made using excel and not follow their real map position.

In my case I have 4 p-values from 4 different phenotypes. They are estimated from same SNPs. I want to stack them in the same plot but distinguish phenotypes by different colors. 

       # Input data format, example. 
       SNP	CHR	POS	pval_1	pval_2	pval_3	pval_4
        a	1	100	0.1	0.5	0.2	0.1
        b	2	110	0.2	0.6	0.3	0.5
        c	3	120	0.3	0.7	0.1	0.6
        d	4	130	0.4	0.1	0.4	0.2


qqman is a very useful R package, unfortunately it is only allowed for single trait.




With a bit of customization you could do it in R with ggplot:

    library(dplyr)
    library(ggplot2)
    
    tmp <- data_frame(
      POS=seq(1,10000),
      pval1=1/runif(n = 10000, min=0, max=0.2),
      pval2=1/c(runif(n = 9999, min=0, max=0.2), 1e-5),
      pval3=1/runif(n = 10000, min=0, max=0.3),
      pval4=1/runif(n = 10000, min=0, max=0.4))
      
    tmp.tidy <- tmp %>% gather(key, value, -POS)
    
    ggplot(tmp.tidy, aes(POS, value, color=key)) + 
      geom_point()

**Example**:

[https://ibb.co/mYnb3w][1]

Use the + facet_wrap(~CHR) to create a graph per chromosome. 


  [1]: https://ibb.co/mYnb3w