<?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 Box plot show Different Spec line in a graph by JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Box-plot-show-Different-Spec-line-in-a-graph-by-JSL/m-p/746996#M97926</link>
    <description>&lt;P&gt;As the document 《P1 CAN.jmp》, the graph&amp;nbsp; "FAI 19-Flange" box plot is created by 《&lt;FONT color="#0000FF"&gt;Direct create Boxplot.jsl&lt;/FONT&gt;》, this method does not need to stack data table, but the Spec line is the same&amp;nbsp;&lt;SPAN&gt;Horizontal line. Now, I want to show it as 《&lt;FONT color="#0000FF"&gt;Box&amp;nbsp;Plot.jpg&lt;/FONT&gt;》by Different Spec line, and this method was created by manual operation, it needs to stack data table,&amp;nbsp;how to correct&amp;nbsp;《&lt;FONT color="#0000FF"&gt;Direct create Boxplot.jsl&lt;/FONT&gt;》can auto create?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FAI 19-Flange.jpg" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63302i3C646BE50081CE01/image-size/large?v=v2&amp;amp;px=999" role="button" title="FAI 19-Flange.jpg" alt="FAI 19-Flange.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Box Plot.jpg" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63303i0F38E9895B05CF04/image-size/large?v=v2&amp;amp;px=999" role="button" title="Box Plot.jpg" alt="Box Plot.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 13 Apr 2024 12:20:19 GMT</pubDate>
    <dc:creator>Chris_Liu</dc:creator>
    <dc:date>2024-04-13T12:20:19Z</dc:date>
    <item>
      <title>Box plot show Different Spec line in a graph by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Box-plot-show-Different-Spec-line-in-a-graph-by-JSL/m-p/746996#M97926</link>
      <description>&lt;P&gt;As the document 《P1 CAN.jmp》, the graph&amp;nbsp; "FAI 19-Flange" box plot is created by 《&lt;FONT color="#0000FF"&gt;Direct create Boxplot.jsl&lt;/FONT&gt;》, this method does not need to stack data table, but the Spec line is the same&amp;nbsp;&lt;SPAN&gt;Horizontal line. Now, I want to show it as 《&lt;FONT color="#0000FF"&gt;Box&amp;nbsp;Plot.jpg&lt;/FONT&gt;》by Different Spec line, and this method was created by manual operation, it needs to stack data table,&amp;nbsp;how to correct&amp;nbsp;《&lt;FONT color="#0000FF"&gt;Direct create Boxplot.jsl&lt;/FONT&gt;》can auto create?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FAI 19-Flange.jpg" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63302i3C646BE50081CE01/image-size/large?v=v2&amp;amp;px=999" role="button" title="FAI 19-Flange.jpg" alt="FAI 19-Flange.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Box Plot.jpg" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63303i0F38E9895B05CF04/image-size/large?v=v2&amp;amp;px=999" role="button" title="Box Plot.jpg" alt="Box Plot.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2024 12:20:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Box-plot-show-Different-Spec-line-in-a-graph-by-JSL/m-p/746996#M97926</guid>
      <dc:creator>Chris_Liu</dc:creator>
      <dc:date>2024-04-13T12:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Box plot show Different Spec line in a graph by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Box-plot-show-Different-Spec-line-in-a-graph-by-JSL/m-p/803396#M98030</link>
      <description>&lt;P&gt;Is this what you want&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1727957914562.png" style="width: 770px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68799i048EB7185E174BD1/image-dimensions/770x710?v=v2" width="770" height="710" role="button" title="txnelson_0-1727957914562.png" alt="txnelson_0-1727957914562.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt = current data table();
colNamesX = dt &amp;lt;&amp;lt; get column names(string);
for(i=nitems(colNamesX),i&amp;gt;=1,i--,
	if(contains(colNamesX[i],"Flange")==0,
		remove from(colNamesX,i,1),
		word(4,colNamesX[i],"-.")!="",
			remove from(colNamesX,i,1)
	)
);
colNameColor = column(1)&amp;lt;&amp;lt;get name;

theExpr =
"gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 464 ),
	Show Control Panel( 0 ),
	Variables(";
for each( {col,index}, colNamesX,
	theExpr = theExpr || 
		"X( :\!"" || col || "\!"n, Position( 1 ) ),";
);
theExpr = theExpr ||
	"Color( :\!"" || colNameColor || "\!"n )
	),
	Elements(
		Box Plot(";
for each( {col,index}, colNamesX,
	theExpr = theExpr || 
		"X( " || char(index) || " ),";
);
theExpr = theExpr ||
	"Legend( 3 )
		),
		Points(";
for each( {col,index}, colNamesX,
	theExpr = theExpr || 
		"X( " || char(index) || " ),";
);
theExpr = theExpr ||
	"Legend( 4 )
		)
	)
);";

// Generate the graph
eval(parse(theExpr));

// Add the USL line
// Find the USL row
theUSLRow = (dt &amp;lt;&amp;lt; get rows where(:Phase == "USL"))[1];

// Get the values
USLs = [];
For Each( {col}, colNamesX,
	USLs = USLs || matrix(as column(dt,col)[theUSLRow])
);

// Set the Y axis upper value
report( gb )[AxisBox(2)] &amp;lt;&amp;lt; Max(max(USLs)+.1*(max(USLs)-(report( gb )[AxisBox(2)] &amp;lt;&amp;lt; get min)));

report( gb )[FrameBox(1)] &amp;lt;&amp;lt; Add Graphics Script(
	Pen Color( "red");
	Pen Size( 2 );
	Line Style( "DashDot");
	
	matX = [];
	For(i=0,i&amp;lt;=length(USLs)-1,i++,
		matX = matX || matrix(i-.5) || matrix( i+.5);
	);
	matY = [];
	For(i=1,i&amp;lt;=length(USLs),i++,
		matY = matY || USLs[i] || USLs[i];
	);
	Line(matX,matY);
	Text Color( "red" );
	textPos = {0};
	insert into(textPos,Max(max(USLs)+.025*(max(USLs)-(report( gb )[AxisBox(2)] &amp;lt;&amp;lt; get min))));
	Text( Center Justified, eval(textPos), "USL" );
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 12:19:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Box-plot-show-Different-Spec-line-in-a-graph-by-JSL/m-p/803396#M98030</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-10-03T12:19:47Z</dc:date>
    </item>
  </channel>
</rss>

