<?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: Fill color for multiple reference lines in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273211#M53145</link>
    <description>&lt;P&gt;Reference lines can use a range of values, along with a transparency to blend the color with the background.&amp;nbsp; This example using Big Class sample data produces the image below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");
biv = dt &amp;lt;&amp;lt; Bivariate(
	Y( :weight ),
	X( :height ),
	Fit Line( {Line Color( {212, 73, 88} )} )
);
(biv&amp;lt;&amp;lt;Report)[AxisBox(2)] &amp;lt;&amp;lt; Add Ref Line( {55, 65}, "Solid", "Black", "label", 1, 0.25 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="rangeref.png" style="width: 403px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24658i2D2528E5C71C5D61/image-size/large?v=v2&amp;amp;px=999" role="button" title="rangeref.png" alt="rangeref.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jun 2020 12:59:33 GMT</pubDate>
    <dc:creator>danschikore</dc:creator>
    <dc:date>2020-06-17T12:59:33Z</dc:date>
    <item>
      <title>Fill color for multiple reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273205#M53143</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have added multiple reference lines to the axis axis of a graph.&lt;/P&gt;&lt;P&gt;I´m doing this by looping through a reference line table (DarkLight) based on the main table.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Oxygen consumption = SableData &amp;lt;&amp;lt; Graph Builder(&lt;BR /&gt;Size( 1322, 944 ),&lt;BR /&gt;Variables(&lt;BR /&gt;X( :Name( "Time since first dose-[hours]" ) ),&lt;BR /&gt;Y( :Name( "VO2-[ml/min]" ) ),&lt;BR /&gt;Overlay( :Treatment )&lt;BR /&gt;),&lt;BR /&gt;Elements( Points( X, Y, Legend( 4 ) ) )&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;For( i = 1, i &amp;lt;= N Rows( DarkLight ), i++,
	Report( Oxygen consumption )[AxisBox( 1 )] &amp;lt;&amp;lt; add ref line( DarkLight:name("Time since first dose-[hours]")[i], DarkLight:Phase[i] )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JulieSAppel_0-1592397539450.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24655i0CCAAE46A828B6C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JulieSAppel_0-1592397539450.png" alt="JulieSAppel_0-1592397539450.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyway I can add fill color in between some of the lines (based on column data in the DarkLight table) thereby indicating when it is daytime or nighttime?&lt;/P&gt;&lt;P&gt;Br Julie&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:02:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273205#M53143</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2023-06-11T11:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Fill color for multiple reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273211#M53145</link>
      <description>&lt;P&gt;Reference lines can use a range of values, along with a transparency to blend the color with the background.&amp;nbsp; This example using Big Class sample data produces the image below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");
biv = dt &amp;lt;&amp;lt; Bivariate(
	Y( :weight ),
	X( :height ),
	Fit Line( {Line Color( {212, 73, 88} )} )
);
(biv&amp;lt;&amp;lt;Report)[AxisBox(2)] &amp;lt;&amp;lt; Add Ref Line( {55, 65}, "Solid", "Black", "label", 1, 0.25 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="rangeref.png" style="width: 403px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24658i2D2528E5C71C5D61/image-size/large?v=v2&amp;amp;px=999" role="button" title="rangeref.png" alt="rangeref.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 12:59:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273211#M53145</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2020-06-17T12:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Fill color for multiple reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273218#M53146</link>
      <description>&lt;P&gt;I knew how this message worked but when I went to the Scripting Index to get a reference for Julie, I discovered it is incomplete:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 428px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24660i7CBF368004093AD1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 13:22:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273218#M53146</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-06-17T13:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Fill color for multiple reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273233#M53147</link>
      <description>&lt;P&gt;Thanks for the replies but this would require that I manually add the reference lines. My data set is constantly changing so I am looking for at solution where I can use the reference table that I have scripted to be created every time I run my data through this and automatically add the reference lines to the graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I can´t seem to come up with a solution that adds different properties to the different ref lines when they are added like this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 13:42:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273233#M53147</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2020-06-17T13:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Fill color for multiple reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273235#M53148</link>
      <description>&lt;P&gt;You iterate over the rows in your reference table and add a reference line (range) each time. Our answers did not involve the UI, only scripts, so it is not clear why you are confused or unable to proceed.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 13:48:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273235#M53148</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-06-17T13:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Fill color for multiple reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273238#M53149</link>
      <description>&lt;P&gt;My problem concerns this part in one of the suggestions:&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;Add Ref Line( {55, 65}, "Solid", "Black", "label", 1, 0.25 )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This would add two ref lines at 55 and 65 and they have the same properties (solid, black etc).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I need to add e.g. a 100 ref lines which change depending on the specific data set being run through the script and they need to be shown with different properties (e.g. one is dotted and red, the next one is solid and blue etc).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would you do that without having to manually add each value in the script?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 14:00:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273238#M53149</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2020-06-17T14:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Fill color for multiple reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273260#M53152</link>
      <description>&lt;P&gt;Your example does not add two references lines. It adds a colored region in the range when you supply a list with two values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might have to modify the reference data table that you construct. This example should illustrate the approach;&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 );

// data table with reference line specifications
ref dt = New Table( "Reference Lines",
	Add Rows( 5 ),
	New Column( "Segment",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [1, 2, 3, 4, 5] )
	),
	New Column( "Low",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [50, 55, 60, 65, 70] )
	),
	New Column( "High",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [55, 60, 65, 70, 75] )
	),
	New Column( "Color",
		Character,
		"Nominal",
		Set Values( {"Red", "Yellow", "Green", "Yellow", "Red"} )
	)
);

data = Open( "$SAMPLE_DATA/Big Class.jmp" );

biv = data &amp;lt;&amp;lt; Bivariate( Y( :weight ), X( :height ) );

x axis = Report( biv )[AxisBox(2)];

For Each Row( ref dt,
	// draw colored regon
	Eval( Eval Expr( x axis &amp;lt;&amp;lt; Add Ref Line( { Expr( :Low ), Expr( :High ) }, "Solid", Expr( :Color ), , , 0.25 ) ) );
	// draw border lines
	Eval( Eval Expr( x axis &amp;lt;&amp;lt; Add Ref Line( Expr( :Low ), "Solid", "Black" ) ) );
	Eval( Eval Expr( x axis &amp;lt;&amp;lt; Add Ref Line( Expr( :High ), "Solid", "Black" ) ) );
);&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jun 2020 15:16:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273260#M53152</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-06-17T15:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Fill color for multiple reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273402#M53181</link>
      <description>&lt;P&gt;Ok that makes sense. I missed the list part. Thanks for the response - I will change the reference table as you suggest.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 06:33:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Fill-color-for-multiple-reference-lines/m-p/273402#M53181</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2020-06-18T06:33:13Z</dc:date>
    </item>
  </channel>
</rss>

