<?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: Graph Builder - Box plot with groups of columns ? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Graph-Builder-Box-plot-with-groups-of-columns/m-p/285923#M55183</link>
    <description>&lt;P&gt;The way to do this is to simply&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Stack the columns&lt;/LI&gt;
&lt;LI&gt;Make a new column that groups the data&lt;/LI&gt;
&lt;LI&gt;Run the Graph Builder with the Grouping column as the X axis&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abc.PNG" style="width: 443px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26233iF133D401EB1833A8/image-dimensions/443x379?v=v2" width="443" height="379" role="button" title="abc.PNG" alt="abc.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Below is an example using JSL, however each step in the script can be easily done interactively.&amp;nbsp; See the script below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

// Create a sample data table for illustration
dt=new table("TO_CPTO_C",
	add rows(5),
	new column("A.1", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("A.2", formula(randomuniform(70,140)),format("fixed dec",6,2)),	
	new column("A.3", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("A.4", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("A.5", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("A.6", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("B.1", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("B.2", formula(randomuniform(70,140)),format("fixed dec",6,2)),	
	new column("B.3", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("B.4", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("C.1", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("C.2", formula(randomuniform(70,140)),format("fixed dec",6,2)),	
	new column("C.3", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("C.4", formula(randomuniform(70,140)),format("fixed dec",6,2))
);

// Pause so one can see initial data table before moving on
Wait( 5 );

// Stack the columns
// Tables==&amp;gt;Stack
dtStack = dt &amp;lt;&amp;lt; Stack(
	columns(
		:A.1,
		:A.2,
		:A.3,
		:A.4,
		:A.5,
		:A.6,
		:B.1,
		:B.2,
		:B.3,
		:B.4,
		:C.1,
		:C.2,
		:C.3,
		:C.4
	),
	Source Label Column( "Label" ),
	Stacked Data Column( "Data" )
);

// Pause so one can see stacked data table before moving on
Wait( 5 );

// Create a grouping column
dtStack &amp;lt;&amp;lt; New Column("Group", character, formula( left(:Label,1 )));

// Pause so one can see new column before moving on
Wait( 5 );

// Create the Graph, using the Group column as the X axis and Data as the Y axis
dtStack &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :Group ), Y( :Data ) ),
	Elements( Box Plot( X, Y, Legend( 3 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Aug 2020 09:52:20 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-08-14T09:52:20Z</dc:date>
    <item>
      <title>Graph Builder - Box plot with groups of columns ?</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-Box-plot-with-groups-of-columns/m-p/285869#M55174</link>
      <description>&lt;P&gt;I have a small dataset with multiple columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some of these columns are grouped. In the graph builder, can I create single box plot with data per-group, instead of individual columns ?&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="TheNewBee_0-1597370340992.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26231iCD794C418D0C7283/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TheNewBee_0-1597370340992.png" alt="TheNewBee_0-1597370340992.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TheNewBee_1-1597370351674.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26232iEAFBB81A6EAF5838/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TheNewBee_1-1597370351674.png" alt="TheNewBee_1-1597370351674.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:04:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-Box-plot-with-groups-of-columns/m-p/285869#M55174</guid>
      <dc:creator>TheNewBee</dc:creator>
      <dc:date>2023-06-11T11:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder - Box plot with groups of columns ?</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-Box-plot-with-groups-of-columns/m-p/285898#M55178</link>
      <description>&lt;P&gt;I might be misinterpreting your question, and in the future if you attach the JMP data table it might be easier to show you, but I you can stack the A, B and C columns so you have now three columns of data with A, B and C labels.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 04:12:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-Box-plot-with-groups-of-columns/m-p/285898#M55178</guid>
      <dc:creator>statman</dc:creator>
      <dc:date>2020-08-14T04:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder - Box plot with groups of columns ?</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-Box-plot-with-groups-of-columns/m-p/285923#M55183</link>
      <description>&lt;P&gt;The way to do this is to simply&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Stack the columns&lt;/LI&gt;
&lt;LI&gt;Make a new column that groups the data&lt;/LI&gt;
&lt;LI&gt;Run the Graph Builder with the Grouping column as the X axis&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abc.PNG" style="width: 443px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26233iF133D401EB1833A8/image-dimensions/443x379?v=v2" width="443" height="379" role="button" title="abc.PNG" alt="abc.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Below is an example using JSL, however each step in the script can be easily done interactively.&amp;nbsp; See the script below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

// Create a sample data table for illustration
dt=new table("TO_CPTO_C",
	add rows(5),
	new column("A.1", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("A.2", formula(randomuniform(70,140)),format("fixed dec",6,2)),	
	new column("A.3", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("A.4", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("A.5", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("A.6", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("B.1", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("B.2", formula(randomuniform(70,140)),format("fixed dec",6,2)),	
	new column("B.3", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("B.4", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("C.1", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("C.2", formula(randomuniform(70,140)),format("fixed dec",6,2)),	
	new column("C.3", formula(randomuniform(70,140)),format("fixed dec",6,2)),
	new column("C.4", formula(randomuniform(70,140)),format("fixed dec",6,2))
);

// Pause so one can see initial data table before moving on
Wait( 5 );

// Stack the columns
// Tables==&amp;gt;Stack
dtStack = dt &amp;lt;&amp;lt; Stack(
	columns(
		:A.1,
		:A.2,
		:A.3,
		:A.4,
		:A.5,
		:A.6,
		:B.1,
		:B.2,
		:B.3,
		:B.4,
		:C.1,
		:C.2,
		:C.3,
		:C.4
	),
	Source Label Column( "Label" ),
	Stacked Data Column( "Data" )
);

// Pause so one can see stacked data table before moving on
Wait( 5 );

// Create a grouping column
dtStack &amp;lt;&amp;lt; New Column("Group", character, formula( left(:Label,1 )));

// Pause so one can see new column before moving on
Wait( 5 );

// Create the Graph, using the Group column as the X axis and Data as the Y axis
dtStack &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :Group ), Y( :Data ) ),
	Elements( Box Plot( X, Y, Legend( 3 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 09:52:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-Box-plot-with-groups-of-columns/m-p/285923#M55183</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-08-14T09:52:20Z</dc:date>
    </item>
  </channel>
</rss>

