Triad sou.

gplot procedureの参照線

検索してきた方がいたのでメモ。


proc datasets lib = work kill; run;
option linesize = 130 pagesize = 9999 mprint;
dm 'log; clear; output; clear';

%let execpath = " ";
%let Path = " ";
%macro setexecpath;
  %let execpath = %sysfunc(getoption(sysin));
  %if %length(&execpath) = 0 %then
    %let execpath = %sysget(sas_execfilepath);
  data _null_;
    do i = length("&execpath") to 1 by -1;
      if substr("&execpath", i, 1) = "\" then do;
        call symput("Path", substr("&execpath", 1, i));
        stop;
      end;
    end;
  run;
%mend setexecpath;
%setexecpath;
libname Out "&Path";

data Graph;
  do t = 0 to 24 * 8;
    y = rand('Normal', mod(t, 10), 1);
    output;
  end;
run;

goptions reset = all;
goptions ftext = "Times New Roman/bo" ftitle = "Times New Roman/bo";
goptions vsize = 12 in hsize = 19 in htitle = 3 htext = 3;
options linesize = 130 pagesize = 9999;

filename grafout "&Path.Sample.bmp";
goptions device = bmp gsfname = grafout gsfmode = replace;

proc gplot data = Graph;
  plot y * t /
        autovref cautovref = cxE9DECA lautovref = 2
        noframe nolegend haxis = axis1 vaxis = axis2;
  axis1 label = ('Time') major=(w=2 height=0.7) w=2 minor = none;
  axis2 label = (a=90 'Value') major=(w=2 height=1) w=2 minor = none;
  symbol1 i = joins c="cxFAA55C" w = 5;
run; quit;


gplot procedure の場合は

autovref cautovref = cxE9DECA lautovref = 2

を入れると自動で参照線を引いてくれる、cautovrefは色、lautovrefは線種、この2つを省略すると黒実線が引かれる。
vrefと色や線種を被らないようにすることが出来るようになっている。




今度作ろうと思ってるグラフ

  1. 背景の色分け (多分 annotate)
  2. プロット線に影を付ける