How to pass values to Min and Max for Axis via Set Property?The following works for myCol in dt. myCol is Numeric and Continuous
Names Default To Here (1);
dt = Current Data Table();
dt:myCol<< Set Property("Axis", {Min(0.02), Max(10.05), Inc( 0.01 ), Minor Ticks( 1 )});
However the following results in a JMP (v 16.2.0) crash. Where am I going wrong?
ll = 0.02;
ul = 10.05;
dt:Cgd << Set Property( "Axis", {Min(ll), Max(ul), Inc( 0.01 ), Minor Ticks( 1 )});Checking as below shows the issue (see attached when trying to check properties of mCol), but I am out of ideas on how to fix this.
AxLim1 = dt:Cgd << Get Property ("Axis"); show (AxLim1);reports
AxLim1 = {Min(ll), Max(ul), Inc(0.01), Minor Ticks(1)};I think this is something simple which I am missing. Any direction would be very helpful.
ScriptingRe: How to pass values to Min and Max for Axis via Set Property?JMP is not evaluating the variables. Try this work-around:
ll = 0.02;
ul = 10.05;
Eval(
Substitute(
Expr( dt:myCol << Set Property( "Axis", {Min(lll), Max(uuu), Inc( 0.01 ), Minor Ticks( 1 )}) ),
Expr( lll ), ll,
Expr( uuu ), ul
)
);Re: How to pass values to Min and Max for Axis via Set Property?@Mark_Bailey
Thanks. The work around seems to work. Could I have some explanation on of your script steps/functionality?
Re: How to pass values to Min and Max for Axis via Set Property?Your original script supplied variables in the arguments to the Set Property message. As I said, JMP does not evaluate them in this case. This allows you to establish expressions as the parameters in a column property. You want a constant value for the parameter, so you must convert the variable to a literal value in place of the variable. Working from the inside out, I create a template of the desired expression with placeholders (i.e., lll and uuu) for the literal values. I substitute the literal values by evaluating the variables (i.e., ll and ul) for the placeholders. I finally evaluate the resulting expression. You can see this work by selecting the Substitute() function and evaluating it.