<?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: Reverse continuous group Y variable of graph builder in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Reverse-continuous-group-Y-variable-of-graph-builder/m-p/46776#M26643</link>
    <description>&lt;P&gt;The approach I took to solve this problem is to create a new column that has a reversed value and then it applies a Value Label to label the groupings correctly.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// Method 1 ... didn't work
// Column(dt, "weight")&amp;lt;&amp;lt;Set Property( "Axis", {Reversed Scale} );

// Method 2 ... didn't work
// List=sort descending(as list(Column(dt, "weight")&amp;lt;&amp;lt;get values))
// Column(dt, "weight")&amp;lt;&amp;lt;Set Property( "Value Ordering", List);

dt &amp;lt;&amp;lt; New Column( "New Weight",
	ordinal,
	formula(
		If(
			:weight &amp;lt;= Floor( Col Quantile( :weight, .333 ) + 1 ), 3,
			:Weight &amp;lt;= Floor( Col Quantile( :weight, .666 ) + 1 ), 2,
			1
		)
	)
);
Eval(
	Substitute(
			Expr(
				dt:new weight &amp;lt;&amp;lt; set property( "value labels", {3 = _3_, 2 = _2_, 1 = _1_} )
			),
		Expr( _3_ ),
			Char( Min( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 3 )] ) ) || "-" ||
			Char( Max( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 3 )] ) ),
		Expr( _2_ ),
			Char( Max( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 3 )] ) ) || "-" ||
			Char( Max( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 2 )] ) ),
		Expr( _1_ ),
			Char( Max( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 2 )] ) ) || "-" ||
			Char( Max( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 1 )] ) )
	)
);
//Plot
Graph Builder(
	Size( 564, 540 ),
	Show Control Panel( 0 ),
	Variables( X( :sex ), Y( :height ), Group Y( :New Weight, levels( 3 ) ) ),
	Elements( Points( X, Y, Legend( 2 ) ) ),

);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="reverse.PNG" style="width: 586px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8220iF8A78830E8BDF222/image-size/large?v=v2&amp;amp;px=999" role="button" title="reverse.PNG" alt="reverse.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The code is pretty basic, but will work for data where you want it grouped into 3 bins.&amp;nbsp; It could be expanded to allow for any number of levels.&lt;/P&gt;</description>
    <pubDate>Sat, 04 Nov 2017 15:00:36 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2017-11-04T15:00:36Z</dc:date>
    <item>
      <title>Reverse continuous group Y variable of graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/Reverse-continuous-group-Y-variable-of-graph-builder/m-p/46762#M26637</link>
      <description>&lt;P&gt;Usually, we can reverse the X and Y axis in the axis settings -&amp;gt; Reverse order. However, it does not work for "Group" variable, especially of continuous type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt=Open( "$SAMPLE_DATA/Big Class.jmp" );

// Method 1 ... didn't work
// Column(dt, "weight")&amp;lt;&amp;lt;Set Property( "Axis", {Reversed Scale} );

// Method 2 ... didn't work
// List=sort descending(as list(Column(dt, "weight")&amp;lt;&amp;lt;get values))
// Column(dt, "weight")&amp;lt;&amp;lt;Set Property( "Value Ordering", List);

//Plot
Graph Builder(
    Size( 564, 540 ),
    Show Control Panel( 0 ),
    Variables( X( :sex ), Y( :height ), Group Y( :weight, levels(3) ) ),
    Elements( Points( X, Y, Legend( 2 ) ) ),
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8212iBA12EAE4B05300CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "Weight" variable ploted interval of small values on the top and large values in the bottom, but it make more sense to me if the large one be placed on the top like Y-axis. Two different methods have been applied, but all&amp;nbsp;of them didn't work in my case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Method 1:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Set the column property "Axis" in reverse order&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Method 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Set the column property "Value Ordering" in reverse order. In this way, JMP treated the continuous variable as discrete variable in the graph which is not the desired plot.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 21:11:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reverse-continuous-group-Y-variable-of-graph-builder/m-p/46762#M26637</guid>
      <dc:creator>Tzu-Chun</dc:creator>
      <dc:date>2017-11-03T21:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse continuous group Y variable of graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/Reverse-continuous-group-Y-variable-of-graph-builder/m-p/46776#M26643</link>
      <description>&lt;P&gt;The approach I took to solve this problem is to create a new column that has a reversed value and then it applies a Value Label to label the groupings correctly.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// Method 1 ... didn't work
// Column(dt, "weight")&amp;lt;&amp;lt;Set Property( "Axis", {Reversed Scale} );

// Method 2 ... didn't work
// List=sort descending(as list(Column(dt, "weight")&amp;lt;&amp;lt;get values))
// Column(dt, "weight")&amp;lt;&amp;lt;Set Property( "Value Ordering", List);

dt &amp;lt;&amp;lt; New Column( "New Weight",
	ordinal,
	formula(
		If(
			:weight &amp;lt;= Floor( Col Quantile( :weight, .333 ) + 1 ), 3,
			:Weight &amp;lt;= Floor( Col Quantile( :weight, .666 ) + 1 ), 2,
			1
		)
	)
);
Eval(
	Substitute(
			Expr(
				dt:new weight &amp;lt;&amp;lt; set property( "value labels", {3 = _3_, 2 = _2_, 1 = _1_} )
			),
		Expr( _3_ ),
			Char( Min( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 3 )] ) ) || "-" ||
			Char( Max( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 3 )] ) ),
		Expr( _2_ ),
			Char( Max( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 3 )] ) ) || "-" ||
			Char( Max( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 2 )] ) ),
		Expr( _1_ ),
			Char( Max( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 2 )] ) ) || "-" ||
			Char( Max( dt:weight[dt &amp;lt;&amp;lt; get rows where( :New Weight == 1 )] ) )
	)
);
//Plot
Graph Builder(
	Size( 564, 540 ),
	Show Control Panel( 0 ),
	Variables( X( :sex ), Y( :height ), Group Y( :New Weight, levels( 3 ) ) ),
	Elements( Points( X, Y, Legend( 2 ) ) ),

);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="reverse.PNG" style="width: 586px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8220iF8A78830E8BDF222/image-size/large?v=v2&amp;amp;px=999" role="button" title="reverse.PNG" alt="reverse.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The code is pretty basic, but will work for data where you want it grouped into 3 bins.&amp;nbsp; It could be expanded to allow for any number of levels.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2017 15:00:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reverse-continuous-group-Y-variable-of-graph-builder/m-p/46776#M26643</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-11-04T15:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse continuous group Y variable of graph builder</title>
      <link>https://community.jmp.com/t5/Discussions/Reverse-continuous-group-Y-variable-of-graph-builder/m-p/46778#M26644</link>
      <description>Hi Jim, thanks so much for the help. that's really helpful and exactly what I need.</description>
      <pubDate>Sat, 04 Nov 2017 18:23:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reverse-continuous-group-Y-variable-of-graph-builder/m-p/46778#M26644</guid>
      <dc:creator>Tzu-Chun</dc:creator>
      <dc:date>2017-11-04T18:23:54Z</dc:date>
    </item>
  </channel>
</rss>

