<?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: Change Heat Map Color Scale in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Change-Heat-Map-Color-Scale/m-p/266959#M9567</link>
    <description>&lt;P&gt;the easiest approach is the user the RANGE option to set the range of the colorramp to [-1, 1].&amp;nbsp; Look at the doc for the &lt;A href="http://support.sas.com/documentation/cdl/en/grstatgraph/67882/HTML/default/viewer.htm#n11ergda33xtlwn1rdkbl1crim9n.htm" target="_self"&gt;RANGEATTRMAP statement.&lt;/A&gt;&amp;nbsp; the syntax will look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rangeattrmap name='ThreeColor'; 
    range -1 - 1 / rangecolormodel=ThreeColorRamp;
endrangeattrmap;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 28 Apr 2016 14:22:57 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2016-04-28T14:22:57Z</dc:date>
    <item>
      <title>Change Heat Map Color Scale</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-Heat-Map-Color-Scale/m-p/266941#M9566</link>
      <description>&lt;P&gt;I'm using SAS 14.1. I'm making a heat map of Spearman correlations. The x-axis and the y-axis both list the same 14 metals and the color indicates a metal's correlation with another metal. The figure looks good, but I want to change the color scale. Right now, the correlations range from about -.6 to 1 (1 meaning that the metal is perfectly correlated with itself) and the colors range from dark blue to white to dark red. Since 0 isn't right in the middle of this range, a correlation of 0 is indicated by a pale blue, but I would like white to represent 0 since that makes the most intuitive sense. Does anyone know how I can "slide" the color scale down this way so that 0 is white? My code is below and I attached the resulting heat map.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc template;&lt;BR /&gt; define statgraph heatmapparm;&lt;BR /&gt; begingraph;&lt;/P&gt;
&lt;P&gt;layout overlay;&lt;BR /&gt; heatmapparm x=metal_1 y=metal_2 colorresponse=spearman_corr / &lt;BR /&gt; name="heatmapparm";&lt;BR /&gt; continuouslegend "heatmapparm" / location=outside valign=bottom;&lt;BR /&gt; endlayout;&lt;BR /&gt; endgraph;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgrender data=final template=heatmapparm;&lt;BR /&gt;run;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12492iDCEEA18C029BF5D2/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Metals Correlations.png" title="Metals Correlations.png" /&gt;</description>
      <pubDate>Thu, 28 Apr 2016 13:32:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-Heat-Map-Color-Scale/m-p/266941#M9566</guid>
      <dc:creator>acuffza</dc:creator>
      <dc:date>2016-04-28T13:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Change Heat Map Color Scale</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-Heat-Map-Color-Scale/m-p/266959#M9567</link>
      <description>&lt;P&gt;the easiest approach is the user the RANGE option to set the range of the colorramp to [-1, 1].&amp;nbsp; Look at the doc for the &lt;A href="http://support.sas.com/documentation/cdl/en/grstatgraph/67882/HTML/default/viewer.htm#n11ergda33xtlwn1rdkbl1crim9n.htm" target="_self"&gt;RANGEATTRMAP statement.&lt;/A&gt;&amp;nbsp; the syntax will look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rangeattrmap name='ThreeColor'; 
    range -1 - 1 / rangecolormodel=ThreeColorRamp;
endrangeattrmap;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Apr 2016 14:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-Heat-Map-Color-Scale/m-p/266959#M9567</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-04-28T14:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Change Heat Map Color Scale</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-Heat-Map-Color-Scale/m-p/266980#M9568</link>
      <description>&lt;P&gt;Thank you, Rick. I altered my code, ran it and didn't see an&amp;nbsp;error in the log, but the result looked the same. Did I get something about the syntax wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc template;&lt;BR /&gt; define statgraph heatmapparm;&lt;BR /&gt; begingraph;&lt;BR /&gt; rangeattrmap name="ThreeColor";&lt;BR /&gt; range -1-1 / rangecolormodel=ThreeColorRamp;&lt;BR /&gt; endrangeattrmap;&lt;BR /&gt; layout overlay;&lt;BR /&gt; heatmapparm x=metal_1 y=metal_2 colorresponse=spearman_corr / &lt;BR /&gt; name="heatmapparm" /*xbinaxis=false ybinaxis=false*/;&lt;BR /&gt; continuouslegend "heatmapparm" / location=outside valign=bottom;&lt;BR /&gt; endlayout;&lt;BR /&gt; endgraph;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2016 15:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-Heat-Map-Color-Scale/m-p/266980#M9568</guid>
      <dc:creator>acuffza</dc:creator>
      <dc:date>2016-04-28T15:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Change Heat Map Color Scale</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-Heat-Map-Color-Scale/m-p/266985#M9569</link>
      <description>&lt;P&gt;You also need to use the RANGEATTRVAR statement to define the variable that is the response. The following is untested:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rangeattrmap name='ThreeColor'; 
   range -1-1 / rangecolormodel=ThreeColorRamp;
endrangeattrmap;
rangeattrvar attrvar=rangevar var=spearman_corr attrmap=ThreeColor;
...

heatmapparm colorresponse=rangevar ...;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Apr 2016 15:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-Heat-Map-Color-Scale/m-p/266985#M9569</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-04-28T15:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change Heat Map Color Scale</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-Heat-Map-Color-Scale/m-p/266988#M9570</link>
      <description>&lt;P&gt;That worked perfectly! Thank you so much, Rick!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2016 15:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-Heat-Map-Color-Scale/m-p/266988#M9570</guid>
      <dc:creator>acuffza</dc:creator>
      <dc:date>2016-04-28T15:18:00Z</dc:date>
    </item>
  </channel>
</rss>

