2

我正在通过 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 变量的热图,但我想添加交叉线来标记图表的中间。谢谢!!

4

1 回答 1

3

试试这个drawline说法。

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

这会将行添加到文档中的热图示例:

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;
于 2014-12-05T04:43:07.590 回答