plotting 3 variables on a single plot in ggplot2

前端 未结 2 1694
青春惊慌失措
青春惊慌失措 2021-01-24 17:58

Hi have an experiment which consists of three variables, and I would like to plot them all on a single plot.

This is my df:

AB <- data.frame(block=c(\         


        
2条回答
  •  深忆病人
    2021-01-24 18:43

    IF you have different datasets for those variables, then you can specify the data

    ggplot()+
      geom_line(data=A, aes(x=prime, y=RT, group=familiarity,linetype=familiarity), size=1) +
      geom_line(data=B, aes(x=prime, y=RT, group=familiarity,linetype=familiarity), size=1)+
      expand_limits(y=c(500,650))
    

提交回复
热议问题