Writing in the process encountered this drawing problem, need to add a diversity curve in the Manhattan map, the scale difference between the two is relatively large, directly with the Lines function to add, the effect of tragedy. Force the scale gap between the two pictures in the same picture, the effect is probably the following look.
This diagram is not easy to see the difference between the data. To solve this problem, you can use the Twood.plot function in the R Plotrix package to use two different scales in the same diagram, the function is described as follows:
After using this function, draw again:
Ignoring the color collocation and aesthetic problems, at least more intuitive than the previous figure, the two kinds of information can be seen more clearly. Finally put the Code ~ ~ ~
#########################################
# # Plot with the ordinates # #
#########################################
Library (Plotrix)
Set.seed (1234)
Pvalue <-runif (100,0,0.005)
Diversity <-runif (100,0,5)
# Fig 1
x <-seq (1,100)
Pvalue <--log (pvalue)
Plot (c (0,100), C (0,12), type= ' n ', xlab= ' Position ', ylab= ' value ')
Points (pvalue,pch =, col= ' gray50 ')
Lines (x,diversity,col= ' blue ')
# Fig 2
Twoord.plot (x,pvalue,x,diversity,xlab= ' Position ', ylab= '-log pvalue ',
rylab= ' diversity ', lcol= ' gray50 ', rcol= ' Blue ', type=c (' P ', ' l '), lpch=20)
R Language Drawing tips: Use two different scales in the same sheet