<?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: Removing one of the legends from a heatmap in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456529#M15686</link>
    <description>&lt;P&gt;For legends (keylegend, gradlegend, etc), you should refer to the plot's NAME value -- not the statement name. In Reeza's example, the heatmap has the name of "nope1". So, in this case, you would say:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;gradlegend "nope1";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
    <pubDate>Mon, 23 Apr 2018 13:53:33 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2018-04-23T13:53:33Z</dc:date>
    <item>
      <title>Removing one of the legends from a heatmap</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456131#M15657</link>
      <description>&lt;P&gt;I'm not an avid SAS user and have been stuck at this step: I have a working heatmap&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output PearsonCorr=Corr_P;
PROC CORR DATA=sashelp.cars;
   VAR MSRP Horsepower MPG_City MPG_Highway Weight;
RUN;

proc sort data=Corr_P;
  by VARIABLE;
run;

proc transpose data=Corr_P out=CorrLong1(rename=(COL1=Correlation)) name=CorrelationID;
var MSRP Horsepower MPG_City MPG_Highway Weight;
by Variable;
run;

proc transpose data=Corr_P out=CorrLong2(rename=(COL1=p_value)) name=PvalueID;
var PMSRP PHorsepower PMPG_City PMPG_Highway PWeight;
by Variable;
run;
data CorrLong;
merge CorrLong1 CorrLong2(drop=PvalueID _LABEL_));
   by Variable;
   drop _name_;
   LABEL _NAME_=' '
run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=CorrLong;&lt;BR /&gt;&amp;nbsp; by VARIABLE CorrelationID;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sgplot data=CorrLong;&lt;BR /&gt;heatmap x=Variable y=CorrelationID / colorresponse=Correlation discretex discretey x2axis;&lt;BR /&gt;yaxis reverse display=(nolabel);&lt;BR /&gt;x2axis display=(nolabel);&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything works fine above, but as soon as I add a text overlay, I get an x axis label that I'm unable to get rid of:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=CorrLong;
heatmap x=Variable y=CorrelationID / colorresponse=Correlation discretex discretey x2axis colormodel=ThreeColorRamp; *Colorresponse allows discrete squares for each correlation. x2axis bring the label to the top;
text x=Variable y=CorrelationID text=p_value  / textattrs=(size=10pt) x2axis; /*To overlay significance, create a variable that contans that info and set text=VARIABLE */
label correlation='Pearson Correlation';
yaxis reverse display=(nolabel);
x2axis display=(nolabel);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've already tried noautolegend + gradlegend, keylegend, colormodel with various combinations and cannot resolve this stubborn issue. I know it's a keylegend item because I can move it around with that option, but keylegen &lt;EM&gt;exclude&amp;nbsp;&lt;/EM&gt;option did not get rid of it. My goal is to keep the gradient legend on the right side. I'm sure someone can tell me what's the obvious code that I'm missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Apr 2018 02:31:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456131#M15657</guid>
      <dc:creator>Excelsius</dc:creator>
      <dc:date>2018-04-21T02:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Removing one of the legends from a heatmap</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456135#M15658</link>
      <description>&lt;P&gt;Note: this was edited to make sure the gradient legend is included.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOAUTOLEGEND + GRADLEGEND works for me. What version of SAS are you using? You can check your status with the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc product_status;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is the working code, your sample didn't run so I'm including the full code after I modified it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output PearsonCorr=Corr_P;

PROC CORR DATA=sashelp.cars;
    VAR MSRP Horsepower MPG_City MPG_Highway Weight;
RUN;

proc sort data=Corr_P;
    by VARIABLE;
run;

proc transpose data=Corr_P out=CorrLong1(rename=(COL1=Correlation)) 
        name=CorrelationID;
    var MSRP Horsepower MPG_City MPG_Highway Weight;
    by Variable;
run;

proc transpose data=Corr_P out=CorrLong2(rename=(COL1=p_value)) name=PvalueID;
    var PMSRP PHorsepower PMPG_City PMPG_Highway PWeight;
    by Variable;
run;

data CorrLong;
    merge CorrLong1 CorrLong2(drop=PvalueID );
    by Variable;
    LABEL CorrelationID="Correlations"; run;

proc sort data=CorrLong;
    by VARIABLE CorrelationID;
run;



proc sgplot data=CorrLong noautolegend;
heatmap x=Variable y=CorrelationID / colorresponse=Correlation name="nope1" discretex discretey x2axis colormodel=ThreeColorRamp; *Colorresponse allows discrete squares for each correlation. x2axis bring the label to the top;
text x=Variable y=CorrelationID text=p_value  / textattrs=(size=10pt) x2axis name='nope2'; /*To overlay significance, create a variable that contans that info and set text=VARIABLE */
label correlation='Pearson Correlation';
yaxis reverse display=(nolabel);
x2axis display=(nolabel);
gradlegend;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;LI-SPOILER&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/113285"&gt;@Excelsius&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I'm not an avid SAS user and have been stuck at this step: I have a working heatmap&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output PearsonCorr=Corr_P;
PROC CORR DATA=sashelp.cars;
   VAR MSRP Horsepower MPG_City MPG_Highway Weight;
RUN;

proc sort data=Corr_P;
  by VARIABLE;
run;

proc transpose data=Corr_P out=CorrLong1(rename=(COL1=Correlation)) name=CorrelationID;
var MSRP Horsepower MPG_City MPG_Highway Weight;
by Variable;
run;

proc transpose data=Corr_P out=CorrLong2(rename=(COL1=p_value)) name=PvalueID;
var PMSRP PHorsepower PMPG_City PMPG_Highway PWeight;
by Variable;
run;
data CorrLong;
merge CorrLong1 CorrLong2(drop=PvalueID _LABEL_));
   by Variable;
   drop _name_;
   LABEL _NAME_=' '
run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=CorrLong;&lt;BR /&gt;&amp;nbsp; by VARIABLE CorrelationID;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sgplot data=CorrLong;&lt;BR /&gt;heatmap x=Variable y=CorrelationID / colorresponse=Correlation discretex discretey x2axis;&lt;BR /&gt;yaxis reverse display=(nolabel);&lt;BR /&gt;x2axis display=(nolabel);&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everything works fine above, but as soon as I add a text overlay, I get an x axis label that I'm unable to get rid of:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=CorrLong;
heatmap x=Variable y=CorrelationID / colorresponse=Correlation discretex discretey x2axis colormodel=ThreeColorRamp; *Colorresponse allows discrete squares for each correlation. x2axis bring the label to the top;
text x=Variable y=CorrelationID text=p_value  / textattrs=(size=10pt) x2axis; /*To overlay significance, create a variable that contans that info and set text=VARIABLE */
label correlation='Pearson Correlation';
yaxis reverse display=(nolabel);
x2axis display=(nolabel);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I've already tried noautolegend + gradlegend, keylegend, colormodel with various combinations and cannot resolve this stubborn issue. I know it's a keylegend item because I can move it around with that option, but keylegen &lt;EM&gt;exclude&amp;nbsp;&lt;/EM&gt;option did not get rid of it. My goal is to keep the gradient legend on the right side. I'm sure someone can tell me what's the obvious code that I'm missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Apr 2018 02:56:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456135#M15658</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-21T02:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Removing one of the legends from a heatmap</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456139#M15659</link>
      <description>&lt;P&gt;Reeza, thank you very much. That works (9.4 M5 14.3). The reason it didn't work for me was because I was using gradlegend 'heatmap'; It didn't occur to me to just use gradlegend alone. This is why SAS syntax can be so frustrating sometimes. I was able to make this same graph in R within 20 min despite that I know R less than SAS!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Honestly, I'm still not sure what's the difference between gradlegend, keylegend, legenditem, etc. Some of this stuff is easiest to learn with examples, but I didn't come across that many. If you have any suggestions for good sources, other than the SAS manual online, let me know. I've already gone through the Little SAS book.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm also curious if there is a way to make half of the correlation matrix into a different shape, such as circles based on the correlation value (without messing with SAS/IML).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Apr 2018 03:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456139#M15659</guid>
      <dc:creator>Excelsius</dc:creator>
      <dc:date>2018-04-21T03:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Removing one of the legends from a heatmap</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456140#M15660</link>
      <description>Regarding the circles, that's a different viz type, at the point, I'd almost consider a scatter plot controlling the symbols to get the shapes you want and putting the values in as text or marker char values.  You'd have to determine the size/spacing which would be a bit of a guess and test procedure. For any topic you're having issues with in SAS search lexjansen.com, especially if it's topic specific. Otherwise, I pretty much rely on the docs but I also use R and Tableau for graphics &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sat, 21 Apr 2018 03:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456140#M15660</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-21T03:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Removing one of the legends from a heatmap</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456202#M15670</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;often write blog examples that demonstrate SGPLOT features like this.&amp;nbsp; Here's &lt;A href="https://blogs.sas.com/content/iml/2016/07/18/color-markers-third-variable-sas.html" target="_self"&gt;a gradlegend example from Rick&lt;/A&gt;.&amp;nbsp; And &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2015/07/15/big-data-visualization/" target="_self"&gt;another from Sanjay is here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Apr 2018 16:39:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456202#M15670</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-04-21T16:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Removing one of the legends from a heatmap</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456420#M15685</link>
      <description>&lt;P&gt;Thanks. I'll read these blogs over time. I have already read some of Rick's blogs.&lt;BR /&gt;&lt;BR /&gt;Question: the gradlegend in the example above has a scale that only includes -0.5 and +0.5. Is it possible to customize this scale to display numbers with 0.2 increments (-0.4, -0.2, 0, 0.2, etc)? The extractscale option doesn't seem to do anything.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 07:43:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456420#M15685</guid>
      <dc:creator>Excelsius</dc:creator>
      <dc:date>2018-04-23T07:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Removing one of the legends from a heatmap</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456529#M15686</link>
      <description>&lt;P&gt;For legends (keylegend, gradlegend, etc), you should refer to the plot's NAME value -- not the statement name. In Reeza's example, the heatmap has the name of "nope1". So, in this case, you would say:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;gradlegend "nope1";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 13:53:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-one-of-the-legends-from-a-heatmap/m-p/456529#M15686</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2018-04-23T13:53:33Z</dc:date>
    </item>
  </channel>
</rss>

