<?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: row and column total to heat map in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/row-and-column-total-to-heat-map/m-p/918597#M24417</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/408219"&gt;@msrenee1984&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the XAXISTABLE and YAXISTABLE statements in PROC SGPLOT to place the row and column totals on the graph.&lt;/P&gt;
&lt;P&gt;Below is a sample showing how to do this with your PROC SGPLOT code.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data freqout; /* Sample data */
  input year facility count;
  datalines;
2021 1 40
2021 2 30
2022 1 10
2022 2 30
2023 1 30
2023 2 40
;
run;
proc sgplot data=freqout noautolegend; /*temp*/
  heatmap x=year y=facility / colorresponse=Count
  discretex discretey colormodel=(green redTwoColorRamp)outline ;
  yaxis label='Facility Name' valueattrs=(size=8pt) labelattrs=(size=8pt);
  xaxis label='Calender Year' valueattrs=(size=8pt) labelattrs=(size=5pt);
  text x=year y=facility text=count / textattrs=(size=8pt) ;
  yaxistable count /position=right valueattrs=(size=8pt) nolabel;
  xaxistable count /position=top valueattrs=(size=8pt) nolabel;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Marcia&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2024 15:05:33 GMT</pubDate>
    <dc:creator>MarciaS</dc:creator>
    <dc:date>2024-03-01T15:05:33Z</dc:date>
    <item>
      <title>row and column total to heat map</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/row-and-column-total-to-heat-map/m-p/918335#M24414</link>
      <description>&lt;P&gt;Hello , I wanted to know if there is a way to add column and row totals to my heat map?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics / width=12cm height=50cm;&lt;BR /&gt;title "apples eaten Per Facility by Year ";&lt;BR /&gt;title2 "apple Counts (N=5952)";&lt;BR /&gt;/* basic heat map */&lt;BR /&gt;proc sgplot data=freqout; /*temp*/&lt;BR /&gt;heatmap x=year y=facility / colorresponse=Count&lt;BR /&gt;discretex discretey colormodel=(green redTwoColorRamp)outline ;&lt;BR /&gt;yaxis label='Facility Name' valueattrs=(size=4pt) labelattrs=(size=8pt);&lt;BR /&gt;xaxis label='Calender Year' valueattrs=(size=5pt) labelattrs=(size=5pt);&lt;BR /&gt;text x=year y=facility text=count text=total / textattrs=(size=3pt) ;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 22:17:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/row-and-column-total-to-heat-map/m-p/918335#M24414</guid>
      <dc:creator>msrenee1984</dc:creator>
      <dc:date>2024-02-28T22:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: row and column total to heat map</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/row-and-column-total-to-heat-map/m-p/918597#M24417</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/408219"&gt;@msrenee1984&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the XAXISTABLE and YAXISTABLE statements in PROC SGPLOT to place the row and column totals on the graph.&lt;/P&gt;
&lt;P&gt;Below is a sample showing how to do this with your PROC SGPLOT code.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data freqout; /* Sample data */
  input year facility count;
  datalines;
2021 1 40
2021 2 30
2022 1 10
2022 2 30
2023 1 30
2023 2 40
;
run;
proc sgplot data=freqout noautolegend; /*temp*/
  heatmap x=year y=facility / colorresponse=Count
  discretex discretey colormodel=(green redTwoColorRamp)outline ;
  yaxis label='Facility Name' valueattrs=(size=8pt) labelattrs=(size=8pt);
  xaxis label='Calender Year' valueattrs=(size=8pt) labelattrs=(size=5pt);
  text x=year y=facility text=count / textattrs=(size=8pt) ;
  yaxistable count /position=right valueattrs=(size=8pt) nolabel;
  xaxistable count /position=top valueattrs=(size=8pt) nolabel;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Marcia&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 15:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/row-and-column-total-to-heat-map/m-p/918597#M24417</guid>
      <dc:creator>MarciaS</dc:creator>
      <dc:date>2024-03-01T15:05:33Z</dc:date>
    </item>
  </channel>
</rss>

