将参考线添加到SAS热图

时间:2014-12-05 02:56:52

标签: templates graph sas heatmap sas-gtl

我正在通过SAS制作热图。我想在热图中添加参考参考线(水平和垂直),将其分成象限。我的代码现在看起来像这样:

proc template;
  define statgraph heatmapparm;
    begingraph;
      layout overlay;
         heatmapparm x=X_Value y=Y_Value colorresponse=percent / colormodel=(blue yellow red)
          name="heatmapparm" xbinaxis=false ybinaxis=false datatransparency=0;
        continuouslegend "heatmapparm" / location=outside valign=bottom;
      endlayout;
    endgraph;
  end;
run;

proc sgrender data=Data template=heatmapparm;
run;

这绘制了X和Y变量的热图,但我想添加交叉线来标记图形的中间。谢谢!

1 个答案:

答案 0 :(得分:3)

尝试drawline声明。

http://support.sas.com/documentation/cdl/en/grstatgraph/65377/HTML/default/viewer.htm#n19cwbtkb5cslcn1bk80pgw2wxex.htm

这会在doc:

中为热图示例添加行
proc template;
  define statgraph heatmapparm;
    begingraph;
      layout overlay;
        heatmapparm x=height y=weight colorresponse=count /
          name="heatmapparm" xbinaxis=false ybinaxis=false;
        drawline x1=50 y1=0 x2=50 y2=100 /
          x1space=wallpercent y1space=wallpercent
          x2space=wallpercent y2space=wallpercent
          lineattrs=GraphReference  ;
        drawline x1=0 y1=50 x2=100 y2=50 /
          x1space=wallpercent y1space=wallpercent
          x2space=wallpercent y2space=wallpercent
          lineattrs=GraphReference  ;
        continuouslegend "heatmapparm" / location=outside valign=bottom;
      endlayout;
    endgraph;
  end;
run;

proc sgrender data=sashelp.gridded template=heatmapparm;
run;