logo

Drawing a Regression Line on a Julia Plot 📂Julia

Drawing a Regression Line on a Julia Plot

Code

plot.svg

To insert a regression line in the scatter plot of Julia, simply use the option smooth = true.

using Plots

x = rand(100)
scatter(x, 2x .+ 0.1randn(100), smooth = true)
savefig("plot.svg")

Environment

  • OS: Windows
  • julia: v1.8.3
  • Plots v1.38.5