<?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 Multiple reference lines on x-axis in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/270177#M52589</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a project I´m working on I have created a graph with time on the x-axis which shows a period of approx 24 hours. To visually illustrate when it is night time and day time I have added reference lines as shown in the below script and attached image.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Properties for x-axis column:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;SableData &amp;lt;&amp;lt; New Column(
	"Time since first dose-[hours]", 
	Numeric, "Continuous", 
	Format("Best", 12), 
	Formula((:Date Time - :StartTime) / (60 * 60)),
	Set Property("Spec Limits", {LSL(8), USL(20), Show Limits(0)}), Set Selected);	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Creating graph, adding and configuring ref lines:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Oxygen consumption = SableData &amp;lt;&amp;lt; Graph Builder(
	Size( 1007, 689 ),
	Variables(
		X( :Name( "Time since first dose-[hours]" ) ),
		Y( :Name("VO2-[ml/min]" )),
		Overlay( :Treatment )
	),
	Elements( Line( X, Y, Legend( 21 ), Error Bars( "Standard Error" ) ) ),
	SendToReport(
		Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Oxygen consumption" )} ),
		Dispatch(
			{},
			"Time since first dose-[hours]",
			ScaleBox,
			{Min( 168 ), Max( 288), Inc( 2 ), Minor Ticks( 12 )}
		),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				21,
				Properties( 0, {Line Color( 0 )}, Item ID( "A", 1 ) ),
				Properties(
					1,
					{Line Color( 53 )},
					Item ID( "B", 1 )
				),
				Properties(
					2,
					{Line Color( 37 )},
					Item ID( "C", 1 )
				),
				Properties( 3, {Line Color( 0 )}, Item ID( "A", 2 ) ),
				Properties(
					4,
					{Line Color( 53 )},
					Item ID( "B", 2 )
				),
				Properties(
					5,
					{Line Color( 37 )},
					Item ID( "C", 2 )
				)
			)}
		),
		Dispatch( {}, "Graph Builder", FrameBox, {Marker Size( 0 )} ),
		Dispatch( {}, "400", LegendBox, {Set Title( "" )} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
	Substitute(
			Expr(
				Report( Oxygen consumption )[AxisBox( 1 )] &amp;lt;&amp;lt; Add Ref Line( {__LSL__, __USL__}, "Solid", "Black", "", 1, 0.25 ) //try show limits(1) in spec limits
			),
		Expr( __LSL__ ), (SableData:Name( "Time since first dose-[hours]" ) &amp;lt;&amp;lt; get property( "spec limits" ))["LSL"],
		Expr( __USL__ ), (SableData:Name( "Time since first dose-[hours]" ) &amp;lt;&amp;lt; get property( "spec limits" ))["USL"]
	));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But now I have data covering two weeks and I would still like to illustrate visually when it is night and day. I can of course add these manually but and copy the script but I would like to do this in a robust manner.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can I in any way add these extra properties to the&amp;nbsp;&lt;CODE class=" language-jsl"&gt;"Time since first dose-[hours]"&lt;/CODE&gt; column or is it possible to create a separate data table including all limits and pull them into the data table in one go?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Br Julie&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nightday ref lines.jpg" style="width: 473px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24290iBD25B336FD0AF602/image-dimensions/473x335?v=v2" width="473" height="335" role="button" title="nightday ref lines.jpg" alt="nightday ref lines.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Sun, 11 Jun 2023 11:01:45 GMT</pubDate>
    <dc:creator>JulieSAppel</dc:creator>
    <dc:date>2023-06-11T11:01:45Z</dc:date>
    <item>
      <title>Multiple reference lines on x-axis</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/270177#M52589</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a project I´m working on I have created a graph with time on the x-axis which shows a period of approx 24 hours. To visually illustrate when it is night time and day time I have added reference lines as shown in the below script and attached image.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Properties for x-axis column:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;SableData &amp;lt;&amp;lt; New Column(
	"Time since first dose-[hours]", 
	Numeric, "Continuous", 
	Format("Best", 12), 
	Formula((:Date Time - :StartTime) / (60 * 60)),
	Set Property("Spec Limits", {LSL(8), USL(20), Show Limits(0)}), Set Selected);	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Creating graph, adding and configuring ref lines:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Oxygen consumption = SableData &amp;lt;&amp;lt; Graph Builder(
	Size( 1007, 689 ),
	Variables(
		X( :Name( "Time since first dose-[hours]" ) ),
		Y( :Name("VO2-[ml/min]" )),
		Overlay( :Treatment )
	),
	Elements( Line( X, Y, Legend( 21 ), Error Bars( "Standard Error" ) ) ),
	SendToReport(
		Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Oxygen consumption" )} ),
		Dispatch(
			{},
			"Time since first dose-[hours]",
			ScaleBox,
			{Min( 168 ), Max( 288), Inc( 2 ), Minor Ticks( 12 )}
		),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				21,
				Properties( 0, {Line Color( 0 )}, Item ID( "A", 1 ) ),
				Properties(
					1,
					{Line Color( 53 )},
					Item ID( "B", 1 )
				),
				Properties(
					2,
					{Line Color( 37 )},
					Item ID( "C", 1 )
				),
				Properties( 3, {Line Color( 0 )}, Item ID( "A", 2 ) ),
				Properties(
					4,
					{Line Color( 53 )},
					Item ID( "B", 2 )
				),
				Properties(
					5,
					{Line Color( 37 )},
					Item ID( "C", 2 )
				)
			)}
		),
		Dispatch( {}, "Graph Builder", FrameBox, {Marker Size( 0 )} ),
		Dispatch( {}, "400", LegendBox, {Set Title( "" )} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
	Substitute(
			Expr(
				Report( Oxygen consumption )[AxisBox( 1 )] &amp;lt;&amp;lt; Add Ref Line( {__LSL__, __USL__}, "Solid", "Black", "", 1, 0.25 ) //try show limits(1) in spec limits
			),
		Expr( __LSL__ ), (SableData:Name( "Time since first dose-[hours]" ) &amp;lt;&amp;lt; get property( "spec limits" ))["LSL"],
		Expr( __USL__ ), (SableData:Name( "Time since first dose-[hours]" ) &amp;lt;&amp;lt; get property( "spec limits" ))["USL"]
	));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But now I have data covering two weeks and I would still like to illustrate visually when it is night and day. I can of course add these manually but and copy the script but I would like to do this in a robust manner.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can I in any way add these extra properties to the&amp;nbsp;&lt;CODE class=" language-jsl"&gt;"Time since first dose-[hours]"&lt;/CODE&gt; column or is it possible to create a separate data table including all limits and pull them into the data table in one go?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Br Julie&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nightday ref lines.jpg" style="width: 473px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24290iBD25B336FD0AF602/image-dimensions/473x335?v=v2" width="473" height="335" role="button" title="nightday ref lines.jpg" alt="nightday ref lines.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:01:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/270177#M52589</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2023-06-11T11:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple reference lines on x-axis</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/270707#M52692</link>
      <description>&lt;P&gt;I've used columns to define when to add reference lines. I suppose it would be just as easy to add ranges too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are some notes that might be useful:&amp;nbsp;&lt;LI-MESSAGE title="Event Lines and Comments on Control Charts" uid="29006" url="https://community.jmp.com/t5/Byron-Wingerd-s-Blog/Event-Lines-and-Comments-on-Control-Charts/m-p/29006#U29006" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 17:03:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/270707#M52692</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2020-06-05T17:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple reference lines on x-axis</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/271822#M52902</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4386"&gt;@Byron_JMP&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the setup you describe and it worked to some extend. In order to follow the same process I created a new column in my data table (NewPhase) where the rows that are not missing should result in a event line.&lt;/P&gt;&lt;P&gt;I based the NewPhase column output solely on the animal number with the highest number of rows so that I will only get one set of event lines instead one for each animal:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;DataPointsAnimal = SableData &amp;lt;&amp;lt; Summary(
			Group( :Animal No. ),
			N( :Phase ),
			Freq( "None" ),
			Weight( "None" ));
	
DataPointsAnimalSorted = DataPointsAnimal &amp;lt;&amp;lt; Sort( By( :N Rows ), Order( Descending ) );
Close( DataPointsAnimal, No Save );
AnimalVar = DataPointsAnimalSorted:Animal No.[1];
SableData &amp;lt;&amp;lt; New column("NewPhase", Formula(If( :Animal No. == AnimalVar,
	If( :Phase == Lag( :Phase, 1 ),
		.,
		"new"
	),
	.
)));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I then created the graph with your input&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Size( 924, 695 ),
	Variables(
		X( :Name( "Time since first dose-[hours]" ) ),
		Y( :Name( "EE-[kcal/h]" ) ),
		Overlay( :Treatment )
	),
	Elements( Line( X, Y, Legend( 5 ) ) ),
		SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{Add Graphics Script(
				2,
				Description( "Script" ),
				For Each Row( If( Is Missing( :NewPhase ) == 0, V Line( Row() ) ) );

				For Each Row(
					If( Is Missing( :NewPhase ) == 0,
						Text(
							Right Justified,
							{Row(), Col Maximum( :Name( "EE-[kcal/h]" ) ) * 1.2},
							:Phase
						)
					)
				);
			), Grid Line Order( 1 ), Reference Line Order( 3 )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But for some reason it only includes a limited amount of lines and it doesn´t include any text at all.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 15:23:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/271822#M52902</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2020-06-10T15:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple reference lines on x-axis</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/273814#M53204</link>
      <description>&lt;P&gt;it looks like it works fine, just not as expected, due possibly to an outlier...&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-06-18 at 1.18.55 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24695i44DC7E593A19B6E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-06-18 at 1.18.55 PM.png" alt="Screen Shot 2020-06-18 at 1.18.55 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;the column max() of the Y axis variable &amp;nbsp;is over 23. So the text shows up off scale with the rest of the figure.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 17:20:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/273814#M53204</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2020-06-18T17:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple reference lines on x-axis</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/274432#M53230</link>
      <description>&lt;P&gt;The second problem with the light and dark phase lines not showing up where expected is due to a mismatch between the axis variable and the variable used to define where the lines should go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the graph the x axis is a duration and in the custom script the lines are based on the row number, so graph builder uses the row number and plots it on the time duration, which kind of just doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added a couple of columns to the data table, they are similar to some of the original columns, but with some small tweaks and formatting differences.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//if you have the data table open, make it the active table and run this 


dt=current data table();
dt&amp;lt;&amp;lt;New Column( "Time 2",
		Numeric,
		"Continuous",
		Format( ":day:hr:m", 14 ),
		Input Format( ":day:hr:m" ),
		Formula( :DateTime - :StartTime ),
		Set Selected
	);
dt&amp;lt;&amp;lt;New Column( "step2",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( If( :Phase == "Dark phase", 0, 1 ) ),
		Set Selected
	);
dt&amp;lt;&amp;lt;New Column( "phase2",
		Character,
		"Nominal",
		Formula( If( :Phase == "Dark phase", "D", "L" ) )
	);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The next step is to edit the custom script in the graph.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//This script goes into the Custom Script in the graph builder plot
For Each Row( If( Is Missing( :NewPhase ) == 0, V Line( :Time2 ) ) );
For Each Row(
	If( Is Missing( :NewPhase ) == 0,
		Text(  {:Time2, 5 + :step2}, " "||:Phase2 )
	)
);

//The, " "||:phase2, inserts a space before the label so that it isn't touching the phase line.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The result is the fixed graph, like this.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-06-19 at 9.27.11 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24718i8B5AD81A719CED0B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-06-19 at 9.27.11 AM.png" alt="Screen Shot 2020-06-19 at 9.27.11 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With all the changes, the x-axis is now in Days:Hours:minutes format, and all the light and dark phase lines show up in the right place. The phase label is abbreviated so that it doesn't overlap and just make a jumble off messy text.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Graph script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Size( 1455, 290 ),
	Show Control Panel( 0 ),
	Variables( X( :Time2 ), Y( :Name( "EE-[kcal/h]" ) ), Overlay( :Treatment ) ),
	Elements( Line( X, Y, Legend( 5 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Time2",
			ScaleBox,
			{Min( -586333.5 ), Max( 2531060.48337292 ), Interval( "Day" ), Inc( 1 ),
			Minor Ticks( 6 ), Label Row( Label Orientation( "Perpendicular" ) )}
		),
		Dispatch(
			{},
			"EE-[kcal/h]",
			ScaleBox,
			{Format( "Best", 12 ), Min( 1.7751677852349 ), Max( 5.7751677852349 ),
			Inc( 1 ), Minor Ticks( 0 )}
		),
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{Add Graphics Script(
				2,
				Description( "Script" ),
				For Each Row( If( Is Missing( :NewPhase ) == 0, V Line( :Time2 ) ) );
				For Each Row(
					If( Is Missing( :NewPhase ) == 0,
						Text( {:Time2, 5 + :step2}, " " || :Phase2 )
					)
				);
			), Grid Line Order( 1 ), Reference Line Order( 3 ),
			DispatchSeg(
				TopSeg( 1 ),
				{Set Script(
					For Each Row(
						If( Is Missing( :NewPhase ) == 0,
							V Line( :Time2 )
						)
					);
					For Each Row(
						If( Is Missing( :NewPhase ) == 0,
							Text( {:Time2, 5 + :step2}, " " || :Phase2 )
						)
					);
				)}
			)}
		)
	)
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Jun 2020 13:41:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/274432#M53230</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2020-06-19T13:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple reference lines on x-axis</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/275334#M53431</link>
      <description>&lt;P&gt;Wow thanks a lot for the explanation. That made good sense and it works beautifully too.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 06:29:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/275334#M53431</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2020-06-25T06:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple reference lines on x-axis</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/275387#M53439</link>
      <description>&lt;P&gt;That is a very fun data set, thanks for posting it and your questions.&lt;/P&gt;
&lt;P&gt;If I had infinite time, it would look even better if the dark phases were an interval line that was shaded just a little bit grey. &amp;nbsp;Maybe someone else can pick that up and run with it?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 14:43:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/275387#M53439</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2020-06-25T14:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple reference lines on x-axis</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/276946#M53809</link>
      <description>&lt;P&gt;I actually had help with that and it it turned out something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;DarkLight = SableData &amp;lt;&amp;lt; select where(:NewPhase == "new" ) &amp;lt;&amp;lt; subset(
	Output Table("DarkLight"),
	columns(
		:Date,
		:Phase,
		:Name("Time since first dose-[hours]"),
		:NewPhase)
	);

DarkLight:Date &amp;lt;&amp;lt; data type( Character ) &amp;lt;&amp;lt; Set Modeling Type( Nominal );	
DarkLight &amp;lt;&amp;lt; new column("Phase per day", Character, "Nominal", Formula( :Date || "-" || :Phase ) ); 
DarkLight &amp;lt;&amp;lt; new column("High", Numeric, "Continuous", Formula(
	Lag( :Name( "Time since first dose-[hours]" ), -1 ))
);

DarkLight:High &amp;lt;&amp;lt; delete formula;

DarkLight &amp;lt;&amp;lt; new column("Color", Character, "Nominal", set each value("Grey"));
 
column(DarkLight, "Time since first dose-[hours]") &amp;lt;&amp;lt; Set Name("Low");

DarkLight &amp;lt;&amp;lt; select where(:Phase == "Light phase") &amp;lt;&amp;lt; delete rows;

RQ = SableData &amp;lt;&amp;lt; Graph Builder(
	Size( 938, 712 ),
	Variables(
		X( :Name( "Time since first dose-[hours]" ) ),
		Y( :RQ ),
		Overlay( :Treatment )
	),
	Elements( Points( X, Y, Legend( 4 ) ) )
);

x axis = Report( RQ )[AxisBox(1)];

For Each Row( DarkLight,
	// 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;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 15:18:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-reference-lines-on-x-axis/m-p/276946#M53809</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2020-07-06T15:18:06Z</dc:date>
    </item>
  </channel>
</rss>

