<?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 How can I annotate the background with different colors across different Y-axes? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/800824#M97629</link>
    <description>&lt;P&gt;&lt;SPAN&gt;The following JSL can annotate the region of 100 to 120 on the X-axis with a different color, but it cannot span across different Y-axes. How can I modify it to annotate different variable on Y-axes with different background colors for different variables?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BabyDoragon_0-1726834635856.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68484i41C4718559EDC0ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BabyDoragon_0-1726834635856.png" alt="BabyDoragon_0-1726834635856.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Variables(X(:weight), Y(:height),Y(:age)),
	Elements(Points(X, Y, Legend(3))),
	SendToReport(

		Dispatch(
			{},
			"weight",
			ScaleBox,
			{Add Ref Line(100, "Solid", "blue", "", 5),
			Add Ref Line(120, "Solid", "blue", "", 5)}
		)
	)
);

rep = gb &amp;lt;&amp;lt; report;
framebox = rep[frame box(1)];
framebox &amp;lt;&amp;lt; Add Graphics Script(
	Transparency(0.5);
	Fill Color("Gray");
	Rect(100, Y Origin() + Y Range(), 120, Y Origin() , 1)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 20 Sep 2024 12:17:47 GMT</pubDate>
    <dc:creator>BabyDoragon</dc:creator>
    <dc:date>2024-09-20T12:17:47Z</dc:date>
    <item>
      <title>How can I annotate the background with different colors across different Y-axes?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/800824#M97629</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The following JSL can annotate the region of 100 to 120 on the X-axis with a different color, but it cannot span across different Y-axes. How can I modify it to annotate different variable on Y-axes with different background colors for different variables?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BabyDoragon_0-1726834635856.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68484i41C4718559EDC0ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BabyDoragon_0-1726834635856.png" alt="BabyDoragon_0-1726834635856.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Variables(X(:weight), Y(:height),Y(:age)),
	Elements(Points(X, Y, Legend(3))),
	SendToReport(

		Dispatch(
			{},
			"weight",
			ScaleBox,
			{Add Ref Line(100, "Solid", "blue", "", 5),
			Add Ref Line(120, "Solid", "blue", "", 5)}
		)
	)
);

rep = gb &amp;lt;&amp;lt; report;
framebox = rep[frame box(1)];
framebox &amp;lt;&amp;lt; Add Graphics Script(
	Transparency(0.5);
	Fill Color("Gray");
	Rect(100, Y Origin() + Y Range(), 120, Y Origin() , 1)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Sep 2024 12:17:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/800824#M97629</guid>
      <dc:creator>BabyDoragon</dc:creator>
      <dc:date>2024-09-20T12:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I annotate the background with different colors across different Y-axes?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/800836#M97630</link>
      <description>&lt;P&gt;You have multiple FrameBoxes when you have multiple axis (or groups or wraps or pages), so you can for example add separate graphic script to each of them. Simplified version below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Variables(X(:weight), Y(:height), Y(:age)),
	Elements(Points(X, Y, Legend(3)))
);

rep = gb &amp;lt;&amp;lt; report;
fbs = rep &amp;lt;&amp;lt; XPath("//FrameBox");

fbs[1] &amp;lt;&amp;lt; Add Graphics Script(
	Transparency(0.5);
	Fill Color("Gray");
	Rect(100, Y Origin() + Y Range(), 120, Y Origin(), 1);
);

fbs[2] &amp;lt;&amp;lt; Add Graphics Script(
	Transparency(0.5);
	Fill Color("Green");
	Rect(100, Y Origin() + Y Range(), 120, Y Origin(), 1);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1726835169724.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68485iB7DDFC1F25AFCA2F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1726835169724.png" alt="jthi_0-1726835169724.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2024 12:26:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/800836#M97630</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-20T12:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I annotate the background with different colors across different Y-axes?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/804661#M98241</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Additional Question: How can I draw a color box if the X-axis is of data type "text"?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example, I want to mark the range from TIM to JOE with a specific color.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Variables(X(:name), Y(:height), Y(:age)),
	Elements(Points(X, Y, Legend(3)))
);

rep = gb &amp;lt;&amp;lt; report;
fbs = rep &amp;lt;&amp;lt; XPath("//FrameBox");

fbs[1] &amp;lt;&amp;lt; Add Graphics Script(
	Transparency(0.5);
	Fill Color("Gray");
	Rect("TIM", Y Origin() + Y Range(), "JOE", Y Origin(), 1);
);

fbs[2] &amp;lt;&amp;lt; Add Graphics Script(
	Transparency(0.5);
	Fill Color("Green");
	Rect("TIM", Y Origin() + Y Range(), "JOE", Y Origin(), 1);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Oct 2024 11:38:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/804661#M98241</guid>
      <dc:creator>BabyDoragon</dc:creator>
      <dc:date>2024-10-10T11:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I annotate the background with different colors across different Y-axes?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/804663#M98242</link>
      <description>&lt;P&gt;You have to figure out the correct x-axis values and then utilize those&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Variables(X(:name), Y(:height), Y(:age)),
	Elements(Points(X, Y, Legend(3)))
);

rep = gb &amp;lt;&amp;lt; report;
fbs = rep &amp;lt;&amp;lt; XPath("//FrameBox");

fbs[1] &amp;lt;&amp;lt; Add Graphics Script(
	Transparency(0.5);
	Fill Color("Gray");
	Rect(17, Y Origin() + Y Range(), 37, Y Origin(), 1);
);

fbs[2] &amp;lt;&amp;lt; Add Graphics Script(
	Transparency(0.5);
	Fill Color("Green");
	Rect(17, Y Origin() + Y Range(), 37, Y Origin(), 1);
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This can be easy or sometimes very difficult, but you can get the idea by checking X-axis settings and labels&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1728561523500.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68984i45EE127944D8FA5B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1728561523500.png" alt="jthi_0-1728561523500.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 11:58:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/804663#M98242</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-10T11:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I annotate the background with different colors across different Y-axes?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805006#M98287</link>
      <description>&lt;P&gt;&lt;SPAN&gt;How can I use JSL to read the mapping of LABEL and VALUE in the current X-axis? I can't find a method to read the LABEL and corresponding VALUE on the current X-axis. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would like to use MATCH on the text label to obtain the VALUE, and then highlight the specific range of values with a colored box.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 06:19:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805006#M98287</guid>
      <dc:creator>BabyDoragon</dc:creator>
      <dc:date>2024-10-11T06:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can I annotate the background with different colors across different Y-axes?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805812#M98416</link>
      <description>&lt;P&gt;If I remember correctly... (currently) easiest method is to read it from the data table using Summary table or Summarize.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 15:26:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805812#M98416</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-15T15:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can I annotate the background with different colors across different Y-axes?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805964#M98435</link>
      <description>&lt;DIV&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I would like to mark colors on the X-axis in accordance with the user-selected region. However, the X-axis on the chart changes due to the user's use of a local data filter. Since the text form of the X-axis is variable, I cannot specify a fixed value and label correspondence. I hope to directly access the labels and values on the X-axis of the chart or be able to determine the corresponding value and label on the X-axis based on the user's selection on the local data filter. As shown in the script below, I would like to allow the user to select the local data filter and additionally choose the X-axis to be marked with colors. If it is not possible to obtain the currently displayed items on the X-axis of the graph or the selected results on the local data filter, it will not be possible to obtain the corresponding values and labels smoothly. Is there any way to achieve this?"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Variables(X(:name), Y(:height), Y(:age)),
	Elements(Points(X, Y, Legend(3))),
	Local Data Filter(
		Add Filter(
			columns( :name ),
			Where(
				:name == {"ALFRED", "ALICE", "AMY", "BARBARA", "CAROL", "CHRIS",
				"CLAY"}
			),
			Display( :name, N Items( 15 ), Find( Set Text( "" ) ) )
		)
	),
);

rep = gb &amp;lt;&amp;lt; report;
fbs = rep &amp;lt;&amp;lt; XPath("//FrameBox");

fbs[1] &amp;lt;&amp;lt; Add Graphics Script(
	Transparency(0.5);
	Fill Color("Gray");
	Rect(2, Y Origin() + Y Range(), 4, Y Origin(), 1);
);

fbs[2] &amp;lt;&amp;lt; Add Graphics Script(
	Transparency(0.5);
	Fill Color("Green");
	Rect(2, Y Origin() + Y Range(), 4, Y Origin(), 1);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Oct 2024 04:59:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805964#M98435</guid>
      <dc:creator>BabyDoragon</dc:creator>
      <dc:date>2024-10-16T04:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I annotate the background with different colors across different Y-axes?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805965#M98436</link>
      <description>&lt;P&gt;If you have local filter to manage it will most likely get more complicated. Which range do you wish to color? What happens when user filters that out or one end of it?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 05:21:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805965#M98436</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-16T05:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I annotate the background with different colors across different Y-axes?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805966#M98437</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Yes, it does become more complex with the presence of Local data filter. Therefore, I would like to know if there are any techniques to obtain the current items on the X-axis of the Graph or to read the selected options of the Local data filter in order to calculate the mapping table for the current Value and Label.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 05:46:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805966#M98437</guid>
      <dc:creator>BabyDoragon</dc:creator>
      <dc:date>2024-10-16T05:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can I annotate the background with different colors across different Y-axes?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805978#M98439</link>
      <description>&lt;P&gt;You can get different types of values from local data filter and then you can parse/utilize those&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Car Poll.jmp");
dist = dt &amp;lt;&amp;lt; Distribution(
	Nominal Distribution(Column(:country))
);

ldf = dist &amp;lt;&amp;lt; Local Data Filter(
	Add Filter(columns(:sex), Where(:sex == "Female")),
	Mode(Show(1), Include(1))
);

Show(ldf &amp;lt;&amp;lt; get script, ldf &amp;lt;&amp;lt; Get where clause, ldf &amp;lt;&amp;lt; Get Filtered Rows);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1729059133994.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/69154i37A0BD2F303E125F/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_0-1729059133994.png" alt="jthi_0-1729059133994.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Remember to check for the special case where no rows are being filtered&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 06:12:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-annotate-the-background-with-different-colors-across/m-p/805978#M98439</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-16T06:12:46Z</dc:date>
    </item>
  </channel>
</rss>

