<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: spline- legend and filter issue in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/spline-legend-and-filter-issue/m-p/765584#M94531</link>
    <description>&lt;P&gt;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"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This might not be very robust option due to how filter change handler works, but first idea I came up with...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "age") &amp;lt;&amp;lt; Set Property(
	"Value Colors",
	{12 = -13912408, 13 = -4042310, 14 = -4354269, 15 = -13400361, 16 = -2668175, 17 = -10628061}
);

nw = new window("",
	Lineup Box(
		biv = dt &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; 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 &amp;lt;= N Items(groups), i++,
		biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; remove fit);
	);
	biv &amp;lt;&amp;lt; group by(:age);
	biv &amp;lt;&amp;lt; fit spline(0.1, Standardized, {Line Width(2), Report(0)});
	wait(0);

);

ss = ldf &amp;lt;&amp;lt; Make Filter Change Handler(fitlines);
fitlines(1);

Write();
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Jun 2024 15:42:23 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-06-13T15:42:23Z</dc:date>
    <item>
      <title>spline- legend and filter issue</title>
      <link>https://community.jmp.com/t5/Discussions/spline-legend-and-filter-issue/m-p/765358#M94505</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;how to set the same color to both legend and spline regardless of filter?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in edition, when I filter in advance the spline is not working for other filters, what can I do?&lt;/P&gt;
&lt;P&gt;attached relevant script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 &amp;lt;&amp;lt; group by( :entity );
	abc &amp;lt;&amp;lt; fit spline( 0.1, Standardized, {Line Width( 2 ), Report( 0 )} );
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Jun 2024 11:33:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/spline-legend-and-filter-issue/m-p/765358#M94505</guid>
      <dc:creator>Hamal22</dc:creator>
      <dc:date>2024-06-13T11:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: spline- legend and filter issue</title>
      <link>https://community.jmp.com/t5/Discussions/spline-legend-and-filter-issue/m-p/765584#M94531</link>
      <description>&lt;P&gt;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"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This might not be very robust option due to how filter change handler works, but first idea I came up with...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "age") &amp;lt;&amp;lt; Set Property(
	"Value Colors",
	{12 = -13912408, 13 = -4042310, 14 = -4354269, 15 = -13400361, 16 = -2668175, 17 = -10628061}
);

nw = new window("",
	Lineup Box(
		biv = dt &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; 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 &amp;lt;= N Items(groups), i++,
		biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; remove fit);
	);
	biv &amp;lt;&amp;lt; group by(:age);
	biv &amp;lt;&amp;lt; fit spline(0.1, Standardized, {Line Width(2), Report(0)});
	wait(0);

);

ss = ldf &amp;lt;&amp;lt; Make Filter Change Handler(fitlines);
fitlines(1);

Write();
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Jun 2024 15:42:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/spline-legend-and-filter-issue/m-p/765584#M94531</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-13T15:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: spline- legend and filter issue</title>
      <link>https://community.jmp.com/t5/Discussions/spline-legend-and-filter-issue/m-p/767719#M94795</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I meant that if I remove the filter that was initially configure (where)- there is no spline for other data.&lt;/P&gt;&lt;P&gt;what can be done for dealing with it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2024 11:36:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/spline-legend-and-filter-issue/m-p/767719#M94795</guid>
      <dc:creator>Hamal22</dc:creator>
      <dc:date>2024-06-23T11:36:43Z</dc:date>
    </item>
  </channel>
</rss>

