## VREF and HREF

Occasional Contributor
Posts: 16

# VREF and HREF

I am trying to draw a square with coordinates (-1,-1), (1,-1), (-1,-1) and (1,1). I thought i can use VREF = -1 1 and HREF= -1 1. But these give me extra lines that I do not need. Basically, i will like to know how to draw a horizontal line passing through Y=1, beggining at X=-1 and ending at X=1. Or how can I draw a verical line passing through X=1, beggining at Y=-1 and ending at Y=1.
Posts: 3,852

## Re: VREF and HREF

[pre]
data a;
infile cards dsd;
input x y;
cards;
-1,-1
-1,1
1,1
1,-1
-1,-1
;;;;
run;
goptions reset=all;
goptions hsize=6in vsize=6in;
symbol i=join c=red w=2;
proc gplot;
plot y*x;* / noaxis noframe;
run;
quit;
[/pre]
PROC Star
Posts: 2,365

## Re: VREF and HREF

Or if you need to plot a square on top of existing data:

data ANNO;
retain XSYS YSYS '2' COLOR 'red';
FUNCTION='move'; X=12; Y=12; output;
FUNCTION='draw'; X=11; Y=12; output;
FUNCTION='draw'; X=11; Y=11; output;
FUNCTION='draw'; X=12; Y=11; output;
FUNCTION='draw'; X=12; Y=12; output;
run;
proc gplot data=SASHELP.CLASS annotate=ANNO;
plot AGE*AGE;* / noaxis noframe;
run;
quit;
Discussion stats
• 2 replies
• 574 views
• 0 likes
• 3 in conversation