using the dataset CO2 as an example. After I find the regression lines of uptake and Plant (a factor with 12 levels)

lm(uptake ~ Plant, data = CO2) 

lm(formula = uptake ~ Plant, data = CO2)

(Intercept)      Plant.L      Plant.Q  
   27.21310    -22.94230     -4.61669  
    Plant.C      Plant^4      Plant^5  
    4.66802      2.33920      4.31450  
    Plant^6      Plant^7      Plant^8  
   -0.03902     -2.03649     -3.27825  
    Plant^9     Plant^10     Plant^11  
   -9.06702      0.54631      1.91215  

Is there a way I can plot this and add the regression lines to the plot? Plant is a discrete variable, so what should the graph's x axis be? Thanks in advance!

  • 2
    $\begingroup$ Could you tell us what you might mean by "regression lines"? That phrase doesn't seem to make any sense for this model. $\endgroup$
    – whuber
    Jun 4, 2017 at 19:45

1 Answer 1


You could simply plot this using


However, I do have to agree with the other comments that you should question whether this makes any sense whatsoever.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.