2014-12-05 79 views
2

我正在通过SAS制作热图。我想添加参考参考线(水平和垂直)到热图,将其分成象限。我的代码现在看起来是这样的:将参考线添加到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变量的热图,但我想补充十字线,以纪念我的图形的中间。谢谢!!

回答

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; 
+0

好极了!我不得不从墙壁改变为数据值(所以它使用我的数据中的值),但它指导我很好。谢谢! – Code4Days 2014-12-05 20:38:48