Search code examples
rplotregressionlmvisreg

Changing visreg line colour


I'm using the R package visreg to visualise the results of a model. I want to change the colour of the regression line from the default blue to black. Adding col = "black" doesn't help. How do I make this change?

Thanks!


Solution

  • You need to pass col = black in the line.par argument:

    fit <- lm(Ozone ~ Solar.R + Wind + Temp,data=airquality)
    visreg(fit, line.par = list(col = 'black'))
    

    enter image description here