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
mochar
Level III

Query Y axis name

graph1 = dt << Variability Chart(
	Y( :Name( "Age in 2019" ) ),
	X( :Gender ),
	invisible,
	Show Range Bars( 0 ),
	Show Cell Means( 0 ),
	Std Dev Chart( 0 ),
	Automatic Recalc( 1 ),
);

This is a bit from my .jsl script where I have multiple graphs. Is there a way to easily query the Name of whatever graph is in my queque?

For Example... in any object oriented language it would look something like this: graph2.Y.Name. This would get the name of the Y axis.

I need the name in order to save the graph with the proper name based on the Y axis.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Query Y axis name

The name on the Y axis will be the name of the data column used in the Y role. You have that information in order to launch the platform.

 

Alternatively, you can ask the display box object, a text edit box in this case, for its value.

 

Names Default to Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

graph1 = dt << Variability Chart(
	Y( :weight ),
	X( :age )
);

graph1 rep = graph1 << Report;
name = graph1 rep[TextEditBox(1)] << Get Text;

Right-click on the gray triangle in front of the outline box with the contents of interest and select Edit > Show Tree Structure. This tool makes it easier to determine the object you are looking for.

 

JMP does not use the syntax of object.property or object.method.

Learn it once, use it forever!

View solution in original post

4 REPLIES 4
Highlighted

Re: Query Y axis name

The name on the Y axis will be the name of the data column used in the Y role. You have that information in order to launch the platform.

 

Alternatively, you can ask the display box object, a text edit box in this case, for its value.

 

Names Default to Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

graph1 = dt << Variability Chart(
	Y( :weight ),
	X( :age )
);

graph1 rep = graph1 << Report;
name = graph1 rep[TextEditBox(1)] << Get Text;

Right-click on the gray triangle in front of the outline box with the contents of interest and select Edit > Show Tree Structure. This tool makes it easier to determine the object you are looking for.

 

JMP does not use the syntax of object.property or object.method.

Learn it once, use it forever!

View solution in original post

Highlighted
mochar
Level III

Re: Query Y axis name

graph1 = dt << Variability Chart(
	Y( :Name( "Age in 2019" ) ),
	X( :Gender ),
	invisible,
	Show Range Bars( 0 ),
	Show Cell Means( 0 ),
	Std Dev Chart( 0 ),
	Automatic Recalc( 1 ),
        Where( :HairColor == "Brown" )
);

Thanks! Is there a way to query other things? or a page where I can see all of the things that I can query. I'd also like to query the Where() filter condition which does not show up in the Show Tree Structure. That way I can make a graph with the name of the graph title, and the condition so it doesn't overwrite a graph with the same name and different condition.

Highlighted

Re: Query Y axis name

Select Help > Scripting Index. Change the index to show the Display Boxes. You will see that there are a lot of them! They have many unique properties and methods but the also share many common ones. Many of the query messages are common.

 

Can you use a Data Filter instead of a Local Data Filter? If so, it supports such a query:

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
obj = dt <<
Data Filter(
	Add( Filter Columns( :Region, :Lead ) )
);
Wait( 1 );
obj << (Filter Column( :Lead ) <<
Where( :Lead >= .4 & :Lead <= 1.4 ));
txt = obj << get where clause;

Note that this example is also from the Scripting Index.

Learn it once, use it forever!
Highlighted
mochar
Level III

Re: Query Y axis name

unfortunately I'm not able to do the local filter since I have a separate graph for each condition because I don't want the local filter to show up at all. I tried the code above... and would just get "Scriptable" or "Variability[]" back. Any other way to grab what is being filtered?

Article Labels

    There are no labels assigned to this post.