cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
New to using JMP? Hit the ground running with the Early User Edition of Discovery Summit. Register now, free of charge.
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
Neo
Neo
Level VI

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:myCol<< 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:myCol << 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.

 

 

When it's too good to be true, it's neither
1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

3 REPLIES 3

Re: 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
	)
);
Neo
Neo
Level VI

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?

When it's too good to be true, it's neither

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.