BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
whymath
Barite | Level 11
I am working on a heatmap graph using GTL. The main part is finished, albeit a little imperfect. I want the 100% area of the graph wall is used for the heatmap, but there is always a gap between the outline of the graph wall and the heatmap.
Following is an example:
proc template;
  define statgraph heatmapparm;
    begingraph;
      layout overlay/xaxisopts=(linearopts=(viewmin=50 viewmax=80));
        heatmapparm x=height y=weight colorresponse=count /
          name="heatmapparm" xbinaxis=false ybinaxis=false;
        continuouslegend "heatmapparm" / location=outside valign=bottom;
      endlayout;
    endgraph;
  end;
run;

proc sgrender data=sashelp.gridded template=heatmapparm;
run;
whymath_0-1696645036580.png
As you can see, there are four gaps between the heatmap and the graph wall in four directions. I want to extend the heatmap to fullfill 100% area of the graph wall, is that possible? How to make it in GTL?
1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @whymath,

 

With your sample data it helps to avoid specifying VIEWMIN/VIEWMAX values outside the data range and instead to set THRESHOLDMIN, THRESHOLDMAX, OFFSETMIN and OFFSETMAX to zero. The LINEEXTENT=DATA option seems to be redundant in this case, but could also be included.

layout overlay/xaxisopts=(linearopts=(thresholdmin=0 thresholdmax=0) offsetmin=0 offsetmax=0 /* lineextent=data */)
               yaxisopts=(linearopts=(thresholdmin=0 thresholdmax=0) offsetmin=0 offsetmax=0 /* lineextent=data */);

View solution in original post

2 REPLIES 2
Patrick
Opal | Level 21

Just by trying: You could define the collor for the wallcolor the same as for the minimum value in the colormodel.

proc template;
  define statgraph heatmapparm;
    begingraph;
      layout overlay/xaxisopts=(linearopts=(viewmin=50 viewmax=80)) wallcolor=cx8097b2;
        heatmapparm x=height y=weight colorresponse=count /
          name="heatmapparm" xbinaxis=false ybinaxis=false
          colormodel=(cx8097b2 White cxd05b5b)
          ;
        continuouslegend "heatmapparm" / location=outside valign=bottom;
      endlayout;
    endgraph;
  end;
run;

proc sgrender data=sashelp.gridded template=heatmapparm;
run;
FreelanceReinh
Jade | Level 19

Hello @whymath,

 

With your sample data it helps to avoid specifying VIEWMIN/VIEWMAX values outside the data range and instead to set THRESHOLDMIN, THRESHOLDMAX, OFFSETMIN and OFFSETMAX to zero. The LINEEXTENT=DATA option seems to be redundant in this case, but could also be included.

layout overlay/xaxisopts=(linearopts=(thresholdmin=0 thresholdmax=0) offsetmin=0 offsetmax=0 /* lineextent=data */)
               yaxisopts=(linearopts=(thresholdmin=0 thresholdmax=0) offsetmin=0 offsetmax=0 /* lineextent=data */);

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1118 views
  • 1 like
  • 3 in conversation