<?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: Color coding data points by third variable in sgplot? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199617#M7442</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sanjay and others,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you very much for your help with this. Excellent answers as usual.&amp;nbsp; I will also look into upgrading to TS1M2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bill Price&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jun 2015 18:58:31 GMT</pubDate>
    <dc:creator>pdiff</dc:creator>
    <dc:date>2015-06-16T18:58:31Z</dc:date>
    <item>
      <title>Color coding data points by third variable in sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199612#M7437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a plot using sgplot and scatter that will color code data points based on the value of an endogenous variable. I used to do this through SAS Insight, but that is gone.&amp;nbsp; I thought I could do it through attribute maps, but I am getting errors.&amp;nbsp; In the code below I am plotting 6 values (x,y pairs) color coding by the value of x.&amp;nbsp; Is there a better/easier way to do this.&amp;nbsp; Please excuse the rough state of the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS 9.4 64 bit TS1M1&lt;/P&gt;&lt;P&gt;Windows 7 under Mac Book Pro (Yosemite 10.10.3): Parallels 10.2.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; attrib (&lt;SPAN style="color: #0433ff;"&gt;drop&lt;/SPAN&gt;=x red green blue) ;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;format&lt;/SPAN&gt; red green blue &lt;SPAN style="color: #009193;"&gt;hex2.&lt;/SPAN&gt; ;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;length&lt;/SPAN&gt; linecolor $&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/SPAN&gt; fillcolor $&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;input&lt;/SPAN&gt; @&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; x&amp;nbsp; @&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; value$ y;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; ID = &lt;SPAN style="color: #942193;"&gt;'Test'&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; red = int((x/&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;48&lt;/STRONG&gt;&lt;/SPAN&gt;)*&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;255&lt;/STRONG&gt;&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; green = &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; blue=&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;255&lt;/STRONG&gt;&lt;/SPAN&gt; - red;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; fillcolor= cats(&lt;SPAN style="color: #942193;"&gt;'CX'&lt;/SPAN&gt;,put(red, &lt;SPAN style="color: #009193;"&gt;hex2.&lt;/SPAN&gt;),put(green, &lt;SPAN style="color: #009193;"&gt;hex2.&lt;/SPAN&gt;),put(blue, &lt;SPAN style="color: #009193;"&gt;hex2.&lt;/SPAN&gt;));&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; linecolor=&lt;SPAN style="color: #942193;"&gt;'Black'&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial; color: #0433ff;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;cards&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 1.5 64&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 3 57&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 6 48&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 12 29&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 24 13&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 48 2&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; trial ;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;input&lt;/SPAN&gt; x y;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial; color: #0433ff;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;cards&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 1.5 64&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 3 57&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 6 48&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 12 29&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 24 13&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; 48 2&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial;"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;sgplot&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;data&lt;/SPAN&gt;=trial &lt;SPAN style="color: #0433ff;"&gt;DATTRMAP&lt;/SPAN&gt;=attrib;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial; color: #0433ff;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;scatter&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;x&lt;SPAN style="color: #000000;"&gt;=x &lt;/SPAN&gt;y&lt;SPAN style="color: #000000;"&gt;=y/&lt;/SPAN&gt;FILLEDOUTLINEDMARKERS&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;markerattrs&lt;SPAN style="color: #000000;"&gt;=(symbol=circlefilled &lt;/SPAN&gt;size&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;) &lt;/SPAN&gt;group&lt;SPAN style="color: #000000;"&gt;=x &lt;/SPAN&gt;ATTRID&lt;SPAN style="color: #000000;"&gt;=Test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: Arial; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2015 05:28:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199612#M7437</guid>
      <dc:creator>pdiff</dc:creator>
      <dc:date>2015-06-04T05:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Color coding data points by third variable in sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199613#M7438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to get this to work by:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Removing the &lt;SPAN style="color: #0433ff; font-family: Arial; font-size: 10px; background-color: #ffffff;"&gt;FILLEDOUTLINEDMARKERS&lt;/SPAN&gt; option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Changing the attribute variable name "fillcolor" to "MarkerColor".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a list of keyword for attribute map variables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, what if I still wanted outlined markers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2015 06:33:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199613#M7438</guid>
      <dc:creator>pdiff</dc:creator>
      <dc:date>2015-06-04T06:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Color coding data points by third variable in sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199614#M7439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; There is a section in the ODS Graphics doc for the SG Procedures that discusses Attribute Maps and shows the list of reserved variable names:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/grstatproc/67924/HTML/default/viewer.htm#n18szqcwir8q2nn10od9hhdh2ksj.htm" title="http://support.sas.com/documentation/cdl/en/grstatproc/67924/HTML/default/viewer.htm#n18szqcwir8q2nn10od9hhdh2ksj.htm"&gt;SAS(R) 9.4 ODS Graphics: Procedures Guide, Fourth Edition&lt;/A&gt; (the specific link with reserved variables)&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/grstatproc/67924/HTML/default/viewer.htm#p0teue0ztycuidn14cciruv038ur.htm" title="http://support.sas.com/documentation/cdl/en/grstatproc/67924/HTML/default/viewer.htm#p0teue0ztycuidn14cciruv038ur.htm"&gt;SAS(R) 9.4 ODS Graphics: Procedures Guide, Fourth Edition&lt;/A&gt; (the top link that shows all the sections)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jun 2015 16:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199614#M7439</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-06-06T16:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Color coding data points by third variable in sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199615#M7440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bill,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have Mock, that will be helpful to us to give correct options can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes if you need symbols to present, you have to use markercolor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,'&lt;/P&gt;&lt;P&gt;Durga.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jun 2015 05:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199615#M7440</guid>
      <dc:creator>DR_Majeti</dc:creator>
      <dc:date>2015-06-07T05:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Color coding data points by third variable in sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199616#M7441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you need is a color response based on a variable.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLORRESPONSE is supported for both SCATTER and BUBBLE starting from SAS 9.4(TS1M2).&amp;nbsp; You are using TS1M1, so that option is not available.&amp;nbsp; However, these options are available in GTL in TS1M1.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An easy way to get started would be to run the SGPLOT procedure as you have, and set TMPLOUT="FileName.sas"&amp;nbsp; SGPLOT will write the generated GTL template program to this file name.&amp;nbsp; Template name will be "SGPLOT".&amp;nbsp; Go to the ScatterPlot statement as add the option &lt;SPAN style="color: #000000; font-family: sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;MARKERCOLORGRADIENT=variable.&amp;nbsp; You can also use the COLORMODEL option to get the colors you want, or use DISCERTEATTRMAP to get full control on colors and values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will need to use the following statement to run the graph from template.&amp;nbsp; &lt;/P&gt;&lt;P&gt;proc sgrender data=foo template=sgplot;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 14:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199616#M7441</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-06-15T14:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Color coding data points by third variable in sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199617#M7442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sanjay and others,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you very much for your help with this. Excellent answers as usual.&amp;nbsp; I will also look into upgrading to TS1M2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bill Price&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2015 18:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Color-coding-data-points-by-third-variable-in-sgplot/m-p/199617#M7442</guid>
      <dc:creator>pdiff</dc:creator>
      <dc:date>2015-06-16T18:58:31Z</dc:date>
    </item>
  </channel>
</rss>

