How can I add multiple fits to a plot?

Hi, I can’t figure how to add multiple regression fits to my plot. So say I have this macro:

Lcode = newArray(50, 60, 70, 10, 20, 80, 10);
acode = newArray(10, 10, 40, 60, 30, 90, 10);
bcode = newArray(40, 60, 70, 10, 10, 20, 40);
LL = newArray(50, 60, 80, 10, 10, 70, 10);
La = newArray(10, 10 , 50, 60, 30, 70, 5);
Lb = newArray(50, 60, 70, 10, 20, 30, 40);

Plot.create("LAB calibration", "Reference L*a*b*", "Estimated L*a*b*");
Plot.setLineWidth(2);
Plot.setFontSize(16, "");
Plot.setColor("Black");
Fit.doFit("Straight line", Lcode, LL);
Plot.add("Circles", Lcode, LL);
Plot.setColor("Blue");
Fit.doFit("Straight line", acode, La);
Plot.add("Circles", acode, La);
Plot.setColor("Green");
Fit.doFit("Straight line", bcode, Lb);
Plot.add("Circles", bcode, Lb);
Plot.addLegend("L*\ta*\tb*", "[Bottom-right]");
Plot.show();

I need the graph to look like this:
image
With additional information of the equation of each fit.

Any suggestions for what to do or where to look?

Thanks!

Lee

Plot examples can be found here:

https://imagej.nih.gov/ij/macros/examples/

E.g. for your case:

https://imagej.nih.gov/ij/macros/examples/CurveFittingDemo.txt

https://imagej.nih.gov/ij/macros/examples/PolynomialFit.txt

With the Fit.xxx functions you can the parameters and equations, etc., see:

https://imagej.nih.gov/ij/developer/macro/functions.html#F