cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Hamal22
Level I

spline- legend and filter issue

Hi,

when I run my script the spline and legend colors matches, when I then click on filter- the legend color changes but the spline remain the same- causing confusion in the data.

how to set the same color to both legend and spline regardless of filter?

 

in edition, when I filter in advance the spline is not working for other filters, what can I do?

attached relevant script.

 

 

Lineup Box(
	abc = Bivariate(
		Y( :total_defects ),
		X( :start_date ),
		Automatic Recalc( 1 ),
		Local Data Filter(
			Conditional,
			Add Filter(
				columns( :CU_NC, :ceid, :entity ),
				Where( :CU_NC == "NC" ),
				Where( :ceid == "TNG" ),
				Display( :entity, List Display ),

			)
		),
		SendToReport(
			Dispatch( {}, "1", ScaleBox, {Label Row( Label Orientation( "Angled" ) )} ),
			Dispatch( {}, "2", ScaleBox,
				{Min( -5 ), Max( 250 ), Inc( 7 ), Minor Ticks( 1 ),
				Add Ref Line( 30, "DashDot", "Red", "UCL", 2 ), Label Row( Show Major Grid( 1 ) )}
			),
			Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 800, 250 )} ),
			Dispatch( {}, "Bivar Plot", FrameBox,
				{Frame Size( 800, 250 ), Row Legend(
					entity,
					Color( 1 ),
					Color Theme( "JMP Default"(1) ),
					Marker( 0 ),
					Marker Theme( "" ),
					Continuous Scale( 0 ),
					Reverse Scale( 0 ),
					Excluded Rows( 0 )
				)}
			)
 
		), 
 
	);
	abc << group by( :entity );
	abc << fit spline( 0.1, Standardized, {Line Width( 2 ), Report( 0 )} );
)
2 REPLIES 2
jthi
Super User

Re: spline- legend and filter issue

I think this will require some scripting using filter change handler as those lines do not follow row states / value color column property (also if there is just single point, no line will be fit). I'm not sure what you mean by "not working for other filters"?

 

This might not be very robust option due to how filter change handler works, but first idea I came up with...

Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "age") << Set Property(
	"Value Colors",
	{12 = -13912408, 13 = -4042310, 14 = -4354269, 15 = -13400361, 16 = -2668175, 17 = -10628061}
);

nw = new window("",
	Lineup Box(
		biv = dt << Bivariate(
			Y(:height),
			X(:weight),
			Automatic Recalc(1),
			SendToReport(
				Dispatch({}, "1", ScaleBox, {Label Row(Label Orientation("Angled"))}),
				Dispatch(
					{},
					"2",
					ScaleBox,
					{Min(-5), Max(250), Inc(7), Minor Ticks(1), Add Ref Line(30, "DashDot", "Red", "UCL", 2),
					Label Row(Show Major Grid(1))}
				),
				Dispatch({}, "Bivar Plot", FrameBox, {Frame Size(800, 250)}),
				Dispatch(
					{},
					"Bivar Plot",
					FrameBox,
					{Frame Size(800, 250), Row Legend(
						age,
						Color(1),
						Color Theme(""),
						Marker(0),
						Marker Theme(""),
						Continuous Scale(0),
						Reverse Scale(0),
						Excluded Rows(0)
					)}
				)
			)
		);
	)
);

ldf = biv << Local Data Filter(
	Conditional,
	Add Filter(
		columns(:sex, :name, :age),
		Where(:sex == "M")
	)
);


summarize(dt, groups = by(:age)); // based on your By column

fitlines = Function({a},
	For(i = 1, i <= N Items(groups), i++,
		biv << (Curve[1] << remove fit);
	);
	biv << group by(:age);
	biv << fit spline(0.1, Standardized, {Line Width(2), Report(0)});
	wait(0);

);

ss = ldf << Make Filter Change Handler(fitlines);
fitlines(1);

Write();
-Jarmo
Hamal22
Level I

Re: spline- legend and filter issue

Hi,

I meant that if I remove the filter that was initially configure (where)- there is no spline for other data.

what can be done for dealing with it?