- data demo;
- do x=-10 to 10;
- y=2*x;
- output;
- end;
- run;
- data anno;
- length function $8;
- retain xsys '2' ysys '2' hsys '3' style 'arial' when 'a';
- do x=-13 to 13;
- if x ne 0 then do;
- function='move'; y=0; output;
- function='draw'; y=-0.2; size=0.1; output;
- function='label'; text=put(x,best. -l); size=2; position='e'; output;
- end;
- end;
- do y=-23 to 23;
- if y ne 0 then do;
- function='move'; x=0; output;
- function='draw'; x=-0.05; size=0.1; output;
- function='label'; x=-0.1; text=put(y,best. -l); size=2; position='4'; output;
- end;
- end;
- run;
- goptions reset=all;
- axis1 order=(-13 to 13 by 1) offset=(1.5,1.5) label=none value=none major=none minor=none;
- axis2 order=(-23 to 23 by 1) offset=(0.5,0.5) label=none value=none major=none minor=none;
- symbol c=red i=join;
- proc gplot data=demo anno=anno;
- plot x*y / haxis=axis1 vaxis=axis2 href=0 vref=0;
- run;
- quit;