cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar

Change color of fitted line in Nonlinear

I am using the Nonlinear platform to fit y as a nonlinear function of x. In the plot of y=f(x), I want to change the color of the fitted curve from default black to some other color, so I can use copy and paste frame contents to overlay color-coded versions of the curve as I make manual adjustments to the parameters. By right-clicking in the plot area I am able to select Customize and then change the color of the markers, but I don't see any way of changing the color of the fitted curve. Is it possible to do that (change the color of the fitted curve), and if so, how?

 

Thanks!

1 REPLY 1
jthi
Super User

Re: Change color of fitted line in Nonlinear

One option could be to overlay the graphic script with other graphic script. There might be a way to add pen color to the "Current Model Fit" but I'm not sure how

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Nonlinear Examples/US Population.jmp");
obj = dt << Nonlinear(Y(:pop), X(:"X-formula"n), Finish());
Eval(EvalExpr(
	Report(obj)[FrameBox(1)] << Add Graphics Script(
		p = Expr(Report(obj)[FrameBox(1)]);
		Pen Color("Red");
		f1 = (p << Find Seg(Top Seg(1))) << get script;
		f2 = Arg(f1);
		If(Head Name(f2) == "Y Function",
			Eval(f2);
		);
	);	
));
-Jarmo