Hi @msrenee1984
You can use the XAXISTABLE and YAXISTABLE statements in PROC SGPLOT to place the row and column totals on the graph.
Below is a sample showing how to do this with your PROC SGPLOT code.
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;
Hope this helps.
Regards,
Marcia