<?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: How to change line color in CDF or Quantile plot? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39383#M23029</link>
    <description>&lt;P&gt;You can achieve what you want by setting the Value Colors you want for the :Sex_Class column you are working with.&amp;nbsp; Here is the JSL to do it, but it can easily be done interactively&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
// Create a new column
dt &amp;lt;&amp;lt; new column("Sex_Class", character, 
	formula(:Sex || "_" || char(:Age))
);

// Determine how many groups in the :Sex_Class
summarize(dt,groups=by(:Sex_Class));

// Create the value colors list
colorlist={};
For(i=1,i&amp;lt;=n items(groups),i++,
	If(substr(groups[i],1,1)=="F",
		color=19,
		color=21
	);
	Eval(
		Substitute(
			Expr(
				insert into(colorlist, __group__  )),
				expr( __group__ ), parse("{\!""||groups[i]||"\!""||"="||char(color)||"}")
		)
	)
);

// Set the Value Colors property for the Sex_Class column
dt:sex_CLASS&amp;lt;&amp;lt;set property("value colors",eval(colorlist));

dt &amp;lt;&amp;lt; Oneway(
	Y( :weight ),
	X( :sex_class ),
	All Graphs( 0 ),
	Plot Quantile by Actual( 1 ),
	Line of Fit( 0(1) ),
	X Axis Proportional( 0 ),
	Grand Mean( 0 )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="valuecolors.PNG" style="width: 603px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/6212i9EC8C7B70A168C20/image-size/large?v=v2&amp;amp;px=999" role="button" title="valuecolors.PNG" alt="valuecolors.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 May 2017 01:44:52 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2017-05-19T01:44:52Z</dc:date>
    <item>
      <title>How to change line color in CDF or Quantile plot?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39364#M23019</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am generating cummulative plots like the example below.&lt;/P&gt;&lt;P&gt;However, I want to color of the lines not to be determined by col2 but by col3.&lt;/P&gt;&lt;P&gt;Adding&amp;nbsp;&lt;SPAN&gt;Color ( :col3 ) didn't do the trick...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thx, Phil&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oneway(&lt;BR /&gt;Y( :col1), X( :col2),&lt;BR /&gt;All Graphs( 0 ), Plot Quantile by Actual( 1 ), Line of Fit( 0 ), X Axis Proportional( 0 ), Grand Mean( 0 ), Color ( :col3 )&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 19:03:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39364#M23019</guid>
      <dc:creator>PPS</dc:creator>
      <dc:date>2017-05-18T19:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to change line color in CDF or Quantile plot?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39377#M23026</link>
      <description>&lt;P&gt;I can understand how you could color data points by a different column&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
dt &amp;lt;&amp;lt; Oneway(
	Y( :weight ),
	X( :sex ),
	All Graphs( 0 ),
	Plot Quantile by Actual( 1 ),
	Line of Fit( 0(1) ),
	X Axis Proportional( 0 ),
	Grand Mean( 0 )
);
dt &amp;lt;&amp;lt; color by( :age );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but I don't see how you directly do it with the line segments, since each segment is linked between 2 values that may have 2 different values of the 3rd color.&amp;nbsp;&amp;nbsp; Could you provide a mockup of what you are thinking?&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 21:05:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39377#M23026</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-05-18T21:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to change line color in CDF or Quantile plot?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39380#M23027</link>
      <description>Thx a lot for the swift response.&lt;BR /&gt;Attached is an example with several classes M/F. Each class has its line&lt;BR /&gt;but colors defined by sex.&lt;BR /&gt;Icing on the cake would be color by sex and dash type by class :)&lt;/img&gt;&lt;BR /&gt;Philipp&lt;BR /&gt;&lt;BR /&gt;Oneway(&lt;BR /&gt;Y( :Weight ),&lt;BR /&gt;X( :Sex_Class),&lt;BR /&gt;All Graphs( 0 ), Plot Quantile by Actual( 1 ), Line of Fit( 0 ), X Axis&lt;BR /&gt;Proportional( 0 ), Grand Mean( 0 ), Color ( :sex ),&lt;BR /&gt;SendToReport(&lt;BR /&gt;Dispatch( {"Normal Quantile Plot"}, "Oneway QuantilePlot", FrameBox, {Line&lt;BR /&gt;Width Scale( 3 ), Transparency( 0 )} ),&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;</description>
      <pubDate>Thu, 18 May 2017 22:33:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39380#M23027</guid>
      <dc:creator>PPS</dc:creator>
      <dc:date>2017-05-18T22:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to change line color in CDF or Quantile plot?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39383#M23029</link>
      <description>&lt;P&gt;You can achieve what you want by setting the Value Colors you want for the :Sex_Class column you are working with.&amp;nbsp; Here is the JSL to do it, but it can easily be done interactively&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
// Create a new column
dt &amp;lt;&amp;lt; new column("Sex_Class", character, 
	formula(:Sex || "_" || char(:Age))
);

// Determine how many groups in the :Sex_Class
summarize(dt,groups=by(:Sex_Class));

// Create the value colors list
colorlist={};
For(i=1,i&amp;lt;=n items(groups),i++,
	If(substr(groups[i],1,1)=="F",
		color=19,
		color=21
	);
	Eval(
		Substitute(
			Expr(
				insert into(colorlist, __group__  )),
				expr( __group__ ), parse("{\!""||groups[i]||"\!""||"="||char(color)||"}")
		)
	)
);

// Set the Value Colors property for the Sex_Class column
dt:sex_CLASS&amp;lt;&amp;lt;set property("value colors",eval(colorlist));

dt &amp;lt;&amp;lt; Oneway(
	Y( :weight ),
	X( :sex_class ),
	All Graphs( 0 ),
	Plot Quantile by Actual( 1 ),
	Line of Fit( 0(1) ),
	X Axis Proportional( 0 ),
	Grand Mean( 0 )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="valuecolors.PNG" style="width: 603px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/6212i9EC8C7B70A168C20/image-size/large?v=v2&amp;amp;px=999" role="button" title="valuecolors.PNG" alt="valuecolors.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 01:44:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39383#M23029</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-05-19T01:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to change line color in CDF or Quantile plot?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39393#M23036</link>
      <description>Wow! I'm impressed! It works! I have modified the script to accommodate for&lt;BR /&gt;the case of more than 2 colors:&lt;BR /&gt;&lt;BR /&gt;// Determine colors for lots&lt;BR /&gt;summarize(dt,groups=by(:sex_class));&lt;BR /&gt;colorlist={}; color=3; Sxcnt=Word(1,groups[1],"_");&lt;BR /&gt;For(j=1,j&amp;lt;=n items(groups),j++,&lt;BR /&gt;If(Not(Word(1,groups[j],"_")==Sxcnt),color=color+1;Sxcnt=Word(1,groups[j],"_"));&lt;BR /&gt;Eval(Substitute(Expr(insert into(colorlist, __group__ )), expr( __group__&lt;BR /&gt;), parse("{\!""||groups[j]||"\!""||"="||char(color)||"}") ) );&lt;BR /&gt;);&lt;BR /&gt;dt:sex_class&amp;lt;&lt;BR /&gt;Thanks a lot, but now I got greedy. What about changing dash style by class?&lt;BR /&gt;&lt;BR /&gt;Thanks, Philipp&lt;BR /&gt;</description>
      <pubDate>Fri, 19 May 2017 14:03:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39393#M23036</guid>
      <dc:creator>PPS</dc:creator>
      <dc:date>2017-05-19T14:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to change line color in CDF or Quantile plot?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39400#M23041</link>
      <description>&lt;P&gt;Try this on for size&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
// Create a new column
dt &amp;lt;&amp;lt; New Column( "Sex_Class", character, formula( :Sex || "_" || Char( :Age ) ) );

// Determine how many groups in the :Sex_Class
Summarize( dt, groups = by( :Sex_Class ) );

// Create the value colors list
colorlist = {};
For( i = 1, i &amp;lt;= N Items( groups ), i++,
	If( Substr( groups[i], 1, 1 ) == "F",
		color = 19,
		color = 21
	);
	Eval(
		Substitute(
				Expr(
					Insert Into( colorlist, __group__ )
				),
			Expr( __group__ ), Parse( "{\!"" || groups[i] || "\!"" || "=" || Char( color ) || "}" )
		)
	);
);

// Set the Value Colors property for the Sex_Class column
dt:sex_CLASS &amp;lt;&amp;lt; set property( "value colors", Eval( colorlist ) );

linetype = {"Solid", "Dotted", "DashDot", "DashDotDot", "Dashed"};

TheExpr =
"Oneway(
	Y( :weight ),
	X( :Sex_Class ),
	All Graphs( 0 ),
	Plot Quantile by Actual( 1 ),
	Line of Fit( 0 ),
	X Axis Proportional( 0 ),
	Grand Mean( 0 ),
	SendToReport(
		Dispatch(
			{},
			\!"222\!",
			ScaleBox,
			{Legend Model(
				1,";
For( i = 1, i &amp;lt;= N Items( groups ), i++,
	If( i &amp;gt; 1,
		TheExpr = TheExpr || ","
	);
	TheExpr = TheExpr || "Properties(" || Char( i ) || ", {Line Style(\!"" || linetype[Mod( i, 5 ) + 1] || "\!" )} )";
);
TheExpr = TheExpr || "),
			)}
		
	)";
	
Eval( Parse( theexpr ) );
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are only 5 line styles available&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2017 14:52:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39400#M23041</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-05-19T14:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to change line color in CDF or Quantile plot?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39424#M23053</link>
      <description>Thanks again for your efforts.&lt;BR /&gt;&lt;BR /&gt;I believe there were a few syntax errors in your script suggestion, which I&lt;BR /&gt;fixed. See below. However, I keep getting error messages like "Cannot find&lt;BR /&gt;ScaleBox[ "400" ] at {}", even if I go with "222" as you suggested. (BTW,&lt;BR /&gt;never understood what that number means) And the line styles are not&lt;BR /&gt;adjusted. Colors work ok as before.&lt;BR /&gt;&lt;BR /&gt;thanks, Philipp&lt;BR /&gt;&lt;BR /&gt;Expr =&lt;BR /&gt;"Oneway(&lt;BR /&gt;Y( :weight ),&lt;BR /&gt;X( :Sex_Class ),&lt;BR /&gt;All Graphs( 0 ),&lt;BR /&gt;Plot Quantile by Actual( 1 ),&lt;BR /&gt;Line of Fit( 0 ),&lt;BR /&gt;X Axis Proportional( 0 ),&lt;BR /&gt;Grand Mean( 0 ),&lt;BR /&gt;SendToReport(&lt;BR /&gt;Dispatch({},\!"400\!",&lt;BR /&gt;ScaleBox,&lt;BR /&gt;{Legend Model(1";&lt;BR /&gt;For( i = 1, i &amp;lt;= N Items( groups ), i++,&lt;BR /&gt;Expr = Expr || ",Properties(" || Char( i ) || ", {Line Style(\!"" ||&lt;BR /&gt;linetype[Mod( i, 5 ) + 1] || "\!" )} )";&lt;BR /&gt;);&lt;BR /&gt;Expr = Expr || ")})))";&lt;BR /&gt;&lt;BR /&gt;Eval( Parse( Expr ) );&lt;BR /&gt;</description>
      <pubDate>Fri, 19 May 2017 19:14:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-change-line-color-in-CDF-or-Quantile-plot/m-p/39424#M23053</guid>
      <dc:creator>PPS</dc:creator>
      <dc:date>2017-05-19T19:14:16Z</dc:date>
    </item>
  </channel>
</rss>

