0

How do I plot one graph with lines that are ecdf_Q2<- 50,40,30,20, and 10 instead of just 50?? I need the ggplots to overlap each other. Thank you!

ecdf_Q2 <- **50** %>%   
  ecdf.shift(ratio_threshold, .) %>%   
  filter(nobs > 20) %>% 
  ggplot(aes( x = OUR_ratio_cutoff, y = prob)) +
    geom_line() +
    geom_point() +
    theme_bw(base_size = 12) +
    theme(panel.grid = element_blank()) +    
    scale_y_continuous(limits = c(0,100),    
                       breaks = seq(0,300, by = 10),
                       expand = c(0,0)) +   
    scale_x_continuous(limits = c(0,2), 
                       breaks = seq(0,3, by = 0.1),
                       expand = c(0,0))
r2evans
  • 141,215
  • 6
  • 77
  • 149
trix
  • 11
  • 2
  • `gg < ggplot(...); for (e in list_of_ecdfs) gg <- gg + geom_line(data=e);`? – r2evans May 05 '20 at 23:21
  • trix, welcome to SO! Questions on SO (especially in R) do much better if they are reproducible and self-contained. By that I mean including attempted code (please be explicit about non-base packages), sample representative data (perhaps via `dput(head(x))` or building data programmatically (e.g., `data.frame(...)`), possibly stochastically after `set.seed(1)`), perhaps actual output (with verbatim errors/warnings) versus intended output. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans May 05 '20 at 23:21

0 Answers0