ggplot two way anova line chart

hello, I am trying to make a line chart of a model with two binary X and a continous Y. When I specify one of X as the x axis and in continuous scale, the plot is mostly fine, only that the x axis has other values between 0 and 1 (because I specified it as continuous). The code looks like below:


Since the x axis contains other values between 0 and 1, I specify X as a binary variable, but the code didnt work:

geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?

Why is that? Please give me some advice. Thank you very much.

your first solution, you can control the break points displayed on the x axis

  stat_summary(fun='mean',geom='line') +
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.