BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
whymath
Lapis Lazuli | Level 10
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 */);

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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