Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
ad
ad
Level II

Generate Fit line to Y in log scale -X plot using JSL

Hi,

 

I want to use JSL to plot y1 (in log scale) vs. x1 for only Case == a AND Parameter value ==1 and then fit a line to this y1 (in log) vs. x1 (in linear scale). 

 

Casex1y1Parameter
a1.0567061.0583451
a1.9146622.4959311
a1.8815962.4147522
b1.7925292.2089761
b1.4524591.5721732
b1.4697821.5996462
d1.1726291.1884251
d1.6139621.8477372
d1.5403131.7165453
b1.3078251.3604631
d1.9344862.5459052
a0.650081.9156941
b0.3410041.4063591
c0.3174351.37363
d0.0140951.0141952
a0.1220891.1298543
a0.7271952.0692671
b0.1649831.1793738
c0.6438781.9038491
a0.5017871.651671

 

I am trying this but it gives me error:

 

Bivariate(
Y( :Name( "Y1" ) ),
X( :X1 ),
Fit Special( yTran( "Log" ), {Line Color( {213, 72, 87} )} ),
Fit Where(
:Case == "A"
:Parameter == "1",
Fit Special( yTran( "Log" ), {Line Color( "Dark Green" )} ),
),
SendToReport(
Dispatch(
{},
"1",
ScaleBox,
{Min( 60.936357421875 ), Max( 81.283232421875 ), Inc( 2 ),
Minor Ticks( 1 ), Label Row(
{Show Major Grid( 1 ), Show Minor Grid( 1 )}
)}
),
Dispatch(
{},
"2",
ScaleBox,
{Scale( "Log" ), Format( "Scientific", 11 ), Min( 0.0000002 ),
Max( 0.000634968347287381 ), Inc( 1 ), Minor Ticks( 1 ),
Label Row(
{Show Major Grid( 1 ), Show Minor Grid( 1 ), Set Font Size( 12 )}
)}
)
)
);

 

 

 

Regards,

AD

1 REPLY 1
Highlighted
ms
Super User ms
Super User

Re: Generate Fit line to Y in log scale -X plot using JSL

You do not specify what type of error you experience and your code is difficult to debug.

 

Here is an example that may easier to use as a starting point. The complex dispatch syntax that is generated by JMP is rarely used when writing code "by hand".

bv = Bivariate(
    Y(:y1),
    X(:x1),
    Fit Special(yTran("Log")),
    Where(:Case == "a" & :Parameter == "1"),

);
// Customize axes by sending messages to the Axis Box()
Report(bv)[Axisbox(1)] << {Scale("Log"), inc(1), Minor Ticks(2), Show Major Grid(1),
Show Minor Grid(1)};
Article Labels

    There are no labels assigned to this post.