Hi,
I am facing a problem on which i have to plot three empirical distributions in R with the function "ecdf" but one limitation is that those distributions don't have the same X-axis values.
For example I have three vectors :
vector1 <- c(-5,-10,-5,-9,-7,-9,-6,-4,-1,-3,-6,-8,-7,-5,-5,-4,-6,-8,-9)
vector2 <- c(11,12,45,74,12,122,141,52,54,69,87,54,52,48,96)
vector3 <- c(0.2,0.3,0.3,0.3,0.5,0.9,0.5,0.4,0.6,0.8,0.5,0.6)
I would like to plot the empirical distributions of those three vectors in the same graph (The Y-axis will stay the same, between 0 and 1) but with different X-axis (here, axis x1 will be between -10 and -1 while axis x3 will be between 0 and 1). I have found many questions regarding plotting different curves with different y-axis but never found how to do it with distributions and different X.
Would you have any idea ?
Please use the formatting bar (especially the
code
option) to present your post better. You can use backticks for inline code (`text` becomestext
), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.