BookmarkSubscribeRSS Feed
vince_faller

Super User

Joined:

Mar 17, 2015

find correct axisbox regardless of user preferences

So I'm running into an issue where different user preferences are causing different axis boxes.  I'm tried using xpath but even in that the values are changing for the xpath. 

 

Names default to here(1);
dt = open("$SAMPLE_DATA\Big Class.jmp");

dist = platform(dt, Distribution(
	Stack( 1 ),
	Continuous Distribution(
		Column( :height ),
		Horizontal Layout( 1 ),
		Vertical( 0 ),
		Count Axis( 1 ), 
		normal quantile plot(1)
	)
));

dist1 = platform(dt, 
	Distribution(
		Stack( 1 ),
		Continuous Distribution(
			Column( :height ),
			Horizontal Layout( 1 ),
			Vertical( 0 ),
			normal quantile plot(1)
		)
	);
);

new window("Test", 
	dist, 
	dist1
);


axis = dist[axisbox(2)]; // this is right
axis << Add Ref Line(55);

axis = dist1[axisbox(2)]; // this adds it to the y axis, I need 4
axis << Add Ref Line(55);
5 REPLIES
Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

Re: find correct axisbox regardless of user preferences

Ignore Platform Preferences(1) will run the platform with the default output. You can use that to ensure that you get exactly the report structure you're expecting.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Distribution(
   Ignore Platform Preferences( 1 ),
   Y( :height, :weight ), 
    Histograms Only  
);
-Jeff
vince_faller

Super User

Joined:

Mar 17, 2015

Re: find correct axisbox regardless of user preferences

Not really an option.  Customers won't like it if I change what they see. 

Wendy_Murphrey

Joined:

Jun 23, 2011

Re: find correct axisbox regardless of user preferences

Hey, Vince.

 

Have you tried using XPath with the AxisBox and the DisplayBox immediately above it?  For example, the following adds the reference line at 55 on the X axis if I use dist or dist1:

 

axis = dist1 << XPath( "//BorderBox/AxisBox" );
axis << Add Ref Line( 55 );
Wendy
vince_faller

Super User

Joined:

Mar 17, 2015

Re: find correct axisbox regardless of user preferences

I assume this is specific to this specific axisbox because it doesn't have a listbox around it? That's what it looks like at least.
Highlighted
ian_jmp

Staff

Joined:

Jun 23, 2011

Re: find correct axisbox regardless of user preferences

Not that this is an answer to your question, but for reference lines maybe you can use the column property?

Names default to here(1);
dt = open("$SAMPLE_DATA\Big Class.jmp");

:height << Set Property( "Axis", {Add Ref Line( 55, "Solid", "Black", "", 1 )} );

dist = platform(dt, Distribution(
	Stack( 1 ),
	Continuous Distribution(
		Column( :height ),
		Horizontal Layout( 1 ),
		Vertical( 0 ),
		Count Axis( 1 ), 
		normal quantile plot(1)
	)
));

dist1 = platform(dt, 
	Distribution(
		Stack( 1 ),
		Continuous Distribution(
			Column( :height ),
			Horizontal Layout( 1 ),
			Vertical( 0 ),
			normal quantile plot(1)
		)
	);
);

new window("Test", dist, dist1);

:height << deleteProperty("Axis");