/* Set-up graphics environment */
goptions reset=all cback=white border;
/* Create the sample data set, A */
data a;
input xvar yvar;
cards;
1 10
2 20
4 40
5 60
6 80
9 50
10 30
;
run;
/* Create the annotate data set, ANNO which draws the reference lines */
data anno;
length function $ 8;
retain xsys '2' ysys '3' color 'black' when 'a';
do i= 1 to 10 by .25;
if i/int(i)=1 then do;
tickhght=2;
text=left(put(i,2.));
end;
else do;
tickhght=1;
text='';
end;
function='move'; x=i; y=42; output;
function='draw'; x=i; y=42-tickhght; output;
function='label'; x=i; y=45; output;
end;
run;
/* Create the title, axis and symbol definitions */
title1 "How to move the axis into the middle of the graph";
axis1 origin=(15,15)pct major=none minor=none length=60pct offset=(2,2) label=none value=none;
axis2 origin=(45,15)pct major=(h=-1) minor=(n=4 h=-.5) length=60pct offset=(2,2);
axis3 origin=(15,15)pct major=none minor=none order=(1 to 10 by 1) length=60 pct offset=(2,2) label=none value=none;
symbol1 i=j v=dot c=blue;
/* Create the graph */
proc gplot data=a;
plot yvar*xvar / href=5.5 vref=40 vaxis=axis1 haxis=axis3 frame anno=anno;
plot2 yvar*xvar / vaxis=axis2 ;
run;
quit;