<?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: Scatterplot with ramped color of third variable in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-with-ramped-color-of-third-variable/m-p/285069#M10087</link>
    <description>&lt;P&gt;Bummer! &amp;nbsp;SAS version here is 9.4 TS Level 1M1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would have been extremely useful. &amp;nbsp;Well, others reading your answer will benefit, no doubt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you, Rick! &amp;nbsp;Wonderful that you answer so many questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Jul 2016 23:54:52 GMT</pubDate>
    <dc:creator>NKormanik</dc:creator>
    <dc:date>2016-07-16T23:54:52Z</dc:date>
    <item>
      <title>Scatterplot with ramped color of third variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-with-ramped-color-of-third-variable/m-p/284987#M10084</link>
      <description>&lt;P&gt;Time to get fancy. &amp;nbsp;Color-coded third variable would make a particular visual assessment a lot easier. &amp;nbsp;Say, ramp from Blue to Red, based on a third &lt;STRONG&gt;continuous&lt;/STRONG&gt; variable. &amp;nbsp;(Way too many groups to use Groups=. &amp;nbsp;And too many different datasets with different numbers, so need as much generalizability as possible.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Scouting the Internet I see various possibilities, but all seem seriously complicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rick Wicklin's post looks promising. &amp;nbsp;But how to translate to my need, is the question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2014/03/26/color-scatter-plot-markers-by-a-third-variable.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2014/03/26/color-scatter-plot-markers-by-a-third-variable.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assume that I have the following, thus far:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=Have;&lt;BR /&gt;format N f2.0;
scatter x=x y=y / markerchar=N markercharattrs=(size=1);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks to DanH for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With that as starting point, is there a relatively easy way to get the N variable numbers on the plot to show in color as well, ramped from Blue to Red?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assume SAS 9.4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2016 02:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-with-ramped-color-of-third-variable/m-p/284987#M10084</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-07-16T02:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot with ramped color of third variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-with-ramped-color-of-third-variable/m-p/285017#M10085</link>
      <description>&lt;P&gt;Whenever you have a question like this, you should look at the doc. &lt;A href="http://support.sas.com/documentation/cdl/en/grstatproc/67909/HTML/default/viewer.htm#p1lcbd3lhs3t3bn1jk6d8sjt2yqx.htm" target="_self"&gt;The doc for the SCATTER statement&lt;/A&gt;&amp;nbsp;gives the answer on the third line:&lt;/P&gt;
&lt;P&gt;COLORRESPONSE=&amp;nbsp;specifies the numeric column that is used to map colors to a gradient legend&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.class;
scatter x=height y=weight / markerchar=Name colorresponse=age;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to change the colors used for the color ramp, you can use the COLORMODEL= option to choose from a variety of pre-built ramps, or create your own:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.class;
scatter x=height y=weight / markerchar=Name colorresponse=age
   colormodel=(blue green orange red); /* custom 4-color ramp */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The COLORRESPONSE= and COLORMODEL= options were added to the SCATTER statement in SAS 9.m2 (??).&lt;/P&gt;
&lt;P&gt;It was added to other statements (like DOT and SERIES) in&amp;nbsp;SAS 9.4m3.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use the TEXTPLOT statement in SAS 9.4m2. &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2014/08/29/new-graphics-features-in-sas-9-4m2-part-2/" target="_self"&gt;Sanjay wrote a great blog&lt;/A&gt; that has many examples, including chaging size and color.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For older versions of SAS, you can read this article about using the Graph Template Language (GTL) to &lt;A href="http://blogs.sas.com/content/iml/2014/03/26/color-scatter-plot-markers-by-a-third-variable.html" target="_self"&gt;color markers by a continuous variable.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2016 10:56:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-with-ramped-color-of-third-variable/m-p/285017#M10085</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-07-16T10:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot with ramped color of third variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-with-ramped-color-of-third-variable/m-p/285069#M10087</link>
      <description>&lt;P&gt;Bummer! &amp;nbsp;SAS version here is 9.4 TS Level 1M1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would have been extremely useful. &amp;nbsp;Well, others reading your answer will benefit, no doubt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you, Rick! &amp;nbsp;Wonderful that you answer so many questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2016 23:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-with-ramped-color-of-third-variable/m-p/285069#M10087</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-07-16T23:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot with ramped color of third variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-with-ramped-color-of-third-variable/m-p/285072#M10088</link>
      <description>&lt;P&gt;With SAS 9.40M1, you can still use the GTL SCATTERPLOT statement with the MARKERCOLORGRADIENT option. &amp;nbsp;This is the same code that is eventually driven by the SGPLOT. &amp;nbsp;Look up the documentation for the statement in the GTL doc. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4106i9FC6EAD878A67D81/image-size/medium?v=v2&amp;amp;px=-1" border="0" alt="ScatterGradient.png" title="ScatterGradient.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The basic GTL code will look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc template;&lt;BR /&gt;&amp;nbsp; define statgraph class;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; begingraph;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; entrytitle 'Weight by Height for all Students';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; layout overlay;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scatterplot x=height y=weight / group=sex name='a' &lt;STRONG&gt;markercolorgradient=age&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;markerattrs=(symbol=circlefilled size=12);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continuouslegend 'a';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; endlayout;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; endgraph;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgrender data=sashelp.class template=class;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;COLORMODEL takes one of the predefined gradient models from the style. &amp;nbsp;To change that, you have to change one in the style. &amp;nbsp;The SAS 9.40M3 allows setting color model directly in syntax.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2016 00:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-with-ramped-color-of-third-variable/m-p/285072#M10088</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-07-17T00:13:33Z</dc:date>
    </item>
  </channel>
</rss>

