我正在通过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变量的热图,但我想添加交叉线来标记图形的中间。谢谢!
答案 0 :(得分:3)
尝试drawline
声明。
这会在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;